Package javax.jbi

Examples of javax.jbi.JBIException


    protected void resolveAddress(MessageExchangeImpl exchange) throws JBIException {
        ServiceEndpoint theEndpoint = exchange.getEndpoint();
        if (theEndpoint != null) {
            if (theEndpoint instanceof ExternalEndpoint) {
                throw new JBIException("External endpoints can not be used for routing: should be an internal or dynamic endpoint.");
            }
            if (!(theEndpoint instanceof AbstractServiceEndpoint)) {
                throw new JBIException(
                                "Component-specific endpoints can not be used for routing: should be an internal or dynamic endpoint.");
            }
        }
        // Resolve linked endpoints
        if (theEndpoint instanceof LinkedEndpoint) {
            QName svcName = ((LinkedEndpoint) theEndpoint).getToService();
            String epName = ((LinkedEndpoint) theEndpoint).getToEndpoint();
            ServiceEndpoint ep = registry.getInternalEndpoint(svcName, epName);
            if (ep == null) {
                throw new JBIException("Could not resolve linked endpoint: " + theEndpoint);
            }
            theEndpoint = ep;
        }

        // get the context which created the exchange
View Full Code Here


     * @return metadata describing endpoint, or <code>null</code> if metadata is unavailable.
     * @throws JBIException invalid endpoint reference.
     */
    public Document getEndpointDescriptor(ServiceEndpoint endpoint) throws JBIException {
        if (!(endpoint instanceof AbstractServiceEndpoint)) {
            throw new JBIException("Descriptors can not be queried for external endpoints");
        }
        AbstractServiceEndpoint se = (AbstractServiceEndpoint) endpoint;
        // TODO: what if the endpoint is linked or dynamic
        ComponentMBeanImpl component = getComponent(se.getComponentNameSpace());
        return component.getComponent().getServiceDescription(endpoint);
View Full Code Here

    public void registerSystemService(BaseSystemService service, Class interfaceType) throws JBIException {
        try {

            String name = service.getName();
            if (systemServices.containsKey(name)) {
                throw new JBIException("A system service for the name " + name + " is already registered");
            }
            ObjectName objName = createObjectName(service);
            if (LOG.isDebugEnabled()) {
                LOG.debug("Registering system service: " + objName);
            }
            registerMBean(objName, service, interfaceType, service.getDescription());
            systemServices.put(name, objName);
        } catch (MalformedObjectNameException e) {
            throw new JBIException(e);
        } catch (JMException e) {
            throw new JBIException(e);
        }
    }
View Full Code Here

     * @throws JBIException
     */
    public void unregisterSystemService(BaseSystemService service) throws JBIException {
        String name = service.getName();
        if (!systemServices.containsKey(name)) {
            throw new JBIException("A system service for the name " + name + " is not registered");
        }
        ObjectName objName = systemServices.remove(name);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Unregistering system service: " + objName);
        }
View Full Code Here

        try {
            mbeanServerContext.unregisterMBean(name);
            beanMap.remove(name);
        } catch (JMException e) {
            LOG.error("Failed to unregister mbean: " + name, e);
            throw new JBIException(e);
        }
    }
View Full Code Here

        if (beanFactory instanceof DisposableBean) {
            DisposableBean disposable = (DisposableBean) beanFactory;
            try {
                disposable.destroy();
            } catch (Exception e) {
                throw new JBIException("Failed to dispose of the Spring BeanFactory due to: " + e, e);
            }
        }
        super.stop();
    }
View Full Code Here

            // register self with the ManagementContext
            try {
                managementContext.registerMBean(ManagementContext.getContainerObjectName(managementContext.getJmxDomainName(), getName()),
                                this, LifeCycleMBean.class);
            } catch (JMException e) {
                throw new JBIException(e);
            }

            // Initialize listeners after the whole container has been initialized
            // so that they can register themselves as JMX mbeans for example
            if (configuredListeners != null) {
View Full Code Here

     */
    public Logger getLogger(String suffix, String resourceBundleName) throws MissingResourceException, JBIException {
        try {
            return Logger.getLogger(suffix, resourceBundleName);
        } catch (IllegalArgumentException e) {
            throw new JBIException("A logger can not be created using resource bundle " + resourceBundleName);
        }
    }
View Full Code Here

            registry.deregisterComponent(component);
            environmentContext.unreregister(component);
            component.dispose();
            LOG.info("Deactivating component " + componentName);
        } else {
            throw new JBIException("Could not find component " + componentName);
        }
    }
View Full Code Here

     */
    public ObjectName activateComponent(Component component, String description, ActivationSpec activationSpec, boolean pojo,
                    boolean binding, boolean service, String[] sharedLibraries) throws JBIException {
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName());
        if (registry.getComponent(cns) != null) {
            throw new JBIException("A component is already registered for " + cns);
        }
        ComponentContextImpl context = new ComponentContextImpl(this, cns);
        return activateComponent(new File("."), component, description, context, activationSpec, pojo, binding, service, sharedLibraries);
    }
View Full Code Here

TOP

Related Classes of javax.jbi.JBIException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.