/** * Checks if the parameter is null or empty * * @param parameter * parameter to be tested * @param parameterName * name of the parameter * @throws IllegalArgumentException * if parameter is null */ public static void isNullOrEmptyParameter(String parameter, String parameterName) { isEmptyParameter(parameter, parameterName); isNullParameter(parameter, parameterName); }
public void registerExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException { this.logger.start(); ParameterCheckHelper.isNullParameter(externalEndpoint, "externalEndpoint"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); try { this.componentContextCommunication.getEndpointRegistry().registerExternalEndpoint( externalEndpoint); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.externalEndpoints.add(externalEndpoint); this.logger.end(); }
public ServiceEndpoint getEndpoint(QName service, String name) { this.logger.start(); ParameterCheckHelper.isNullParameter(service, "service"); ParameterCheckHelper.isNullParameter(name, "name"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ServiceEndpoint result = null; try { result = this.componentContextCommunication.getEndpointRegistry().getEndpoint(service, name); } catch (Exception e) { this.logger.warning(e.getMessage()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
public void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint) throws JBIException { this.logger.start(); ParameterCheckHelper.isNullParameter(endpoint, "endpoint"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); try { this.componentContextCommunication.getEndpointRegistry().deactivateEndpoint( endpoint.getEndpointName(), endpoint.getServiceName()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.internalEndpoints.remove(endpoint); this.logger.end(); }
public ServiceEndpoint[] getExternalEndpoints(QName interfaceName) { this.logger.start(); ParameterCheckHelper.isNullParameter(interfaceName, "interfaceName"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ServiceEndpoint[] result = null; try { result = this.componentContextCommunication.getEndpointRegistry() .getExternalEndpointsForInterface(interfaceName); } catch (RegistryException e) { this.logger.warning(e.getMessage()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
public ServiceEndpoint[] getEndpointsForService(QName serviceName) { this.logger.start(); ParameterCheckHelper.isNullParameter(serviceName, "serviceName"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ServiceEndpoint[] result = null; try { result = this.componentContextCommunication.getEndpointRegistry() .getInternalEndpointsForService(serviceName, LinkType.STANDARD); } catch (RegistryException e) { this.logger.warning(e.getMessage()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName) { this.logger.start(); ParameterCheckHelper.isNullParameter(serviceName, "serviceName"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ServiceEndpoint[] result = null; try { result = this.componentContextCommunication.getEndpointRegistry() .getExternalEndpointsForService(serviceName); } catch (RegistryException e) { this.logger.warning(e.getMessage()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) { this.logger.start(); ParameterCheckHelper.isNullParameter(epr, "epr"); javax.jbi.servicedesc.ServiceEndpoint result = null; // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); try { for (Installer installer : this.componentContextCommunication.getAdminService() .getInstallers()) { result = installer.getComponent().resolveEndpointReference(epr); if (result != null) { break; } } } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
public Document getEndpointDescriptor(ServiceEndpoint endpoint) throws JBIException { this.logger.start(); Document result = null; ParameterCheckHelper.isNullParameter(endpoint, "endpoint"); if (endpoint instanceof org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint) { this.logger.debug("Just get the description from the service endpoint"); // FIXME = Do not get it but just check if it exists... if (this.getEndpoint(endpoint.getServiceName(), endpoint.getEndpointName()) != null) { // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); try { result = ((org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint) endpoint) .getDescription(); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } if (result == null) { this.logger .debug("Can not find the service description in the service endpoint"); } } } else { this.logger.debug("the Endpoint type must be " + org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint.class.getName()); } this.logger.end(); return result; }
public void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException { this.logger.start(); ParameterCheckHelper.isNullParameter(externalEndpoint, "externalEndpoint"); this.componentContextCommunication.getEndpointRegistry().deregisterExternalEndpoint( externalEndpoint.getEndpointName(), externalEndpoint.getServiceName()); this.externalEndpoints.remove(externalEndpoint); this.logger.end(); }
this.logger.start(); ParameterCheckHelper.isNullParameter(serviceName, "serviceName"); ParameterCheckHelper.isNullParameter(serviceName, "endpointName");