Package org.apache.servicemix.jbi.servicedesc

Examples of org.apache.servicemix.jbi.servicedesc.InternalEndpoint


        Boolean source = (Boolean) exchange.getProperty(FROM_SUBSCRIPTION_MANAGER);
        if (source == null || !source.booleanValue()) {
            List<InternalEndpoint> list = registry.getMatchingSubscriptionEndpoints(exchange);
            if (list != null) {
                for (int i = 0; i < list.size(); i++) {
                    InternalEndpoint endpoint = list.get(i);
                    dispatchToSubscriber(exchange, endpoint);
                }
            }
            return list != null && !list.isEmpty();
        } else {
View Full Code Here


            // get the list of services
            if (service != null) {
                ServiceEndpoint[] ses = registry.getEndpointsForService(service);
                if (ses != null) {
                    for (int i = 0; i < ses.length; i++) {
                        InternalEndpoint se = (InternalEndpoint) ses[i];
                        if (se.getComponentNameSpace() != null && se.getComponentNameSpace().equals(sourceId)) {
                            result = true;
                            break;
                        }
                    }
                }
            }
            if (result && interfaceName != null) {
                ServiceEndpoint[] ses = registry.getEndpointsForInterface(interfaceName);
                if (ses != null) {
                    result = false;
                    for (int i = 0; i < ses.length; i++) {
                        InternalEndpoint se = (InternalEndpoint) ses[i];
                        if (se.getComponentNameSpace() != null && se.getComponentNameSpace().equals(sourceId)) {
                            result = true;
                            break;
                        }
                    }
                }
View Full Code Here

    protected boolean isContainerEmbedded(){
        return container.isEmbedded();
    }

    protected InternalEndpoint matchEndpointByName(ServiceEndpoint[] endpoints, String endpointName) {
        InternalEndpoint result = null;
        if (endpoints != null && endpointName != null && endpointName.length() > 0) {
            for (int i = 0;i < endpoints.length;i++) {
                if (endpoints[i].getEndpointName().equals(endpointName)) {
                    result = (InternalEndpoint) endpoints[i];
                    break;
View Full Code Here

     * @throws JBIException
     */
    public ServiceEndpoint activateEndpoint(ComponentContextImpl context,
                                            QName serviceName,
                                            String endpointName) throws JBIException {
        InternalEndpoint result = endpointRegistry.registerInternalEndpoint(context, serviceName, endpointName);
        return result;
    }
View Full Code Here

     * @param as
     */
    public void registerSubscriptions(ComponentContextImpl context,ActivationSpec as) {
        QName service = as.getService();
        String endpointName = as.getEndpoint();
        InternalEndpoint endpoint = new InternalEndpoint(context.getComponentNameSpace(), endpointName, service);
        SubscriptionSpec[] specs = as.getSubscriptions();
        if (specs != null) {
            for (int i =0; i<specs.length; i++) {
                registerSubscription(context, specs[i], endpoint);
            }
View Full Code Here

     * @param context
     * @param subscription
     * @param endpoint
     */
    public void registerSubscription(ComponentContextImpl context,SubscriptionSpec subscription, ServiceEndpoint endpoint) {
        InternalEndpoint sei = (InternalEndpoint)endpoint;
        subscription.setName(context.getComponentNameSpace());
        subscriptionRegistry.registerSubscription(subscription,sei);
    }
View Full Code Here

     * @param subscription
     * @return the ServiceEndpoint
     */
    public InternalEndpoint deregisterSubscription(ComponentContextImpl context,SubscriptionSpec subscription) {
        subscription.setName(context.getComponentNameSpace());
        InternalEndpoint result = subscriptionRegistry.deregisterSubscription(subscription);
        return result;
    }
View Full Code Here

    }
   
    public ServiceEndpoint[] getEndpointsForComponent(ComponentNameSpace cns) {
        Collection endpoints = new ArrayList();
        for (Iterator iter = getInternalEndpoints().iterator(); iter.hasNext();) {
            InternalEndpoint endpoint = (InternalEndpoint) iter.next();
            if (cns.equals(endpoint.getComponentNameSpace())) {
                endpoints.add(endpoint);
            }
        }
        return asEndpointArray(endpoints);
    }
View Full Code Here

    }
   
    public ServiceEndpoint[] getAllEndpointsForComponent(ComponentNameSpace cns) {
        Collection endpoints = new ArrayList();
        for (Iterator iter = getInternalEndpoints().iterator(); iter.hasNext();) {
            InternalEndpoint endpoint = (InternalEndpoint) iter.next();
            if (cns.equals(endpoint.getComponentNameSpace())) {
                endpoints.add(endpoint);
            }
        }
        for (Iterator iter = getExternalEndpoints().iterator(); iter.hasNext();) {
            ExternalEndpoint endpoint = (ExternalEndpoint) iter.next();
            if (cns.equals(endpoint.getComponentNameSpace())) {
                endpoints.add(endpoint);
            }
        }
        return asEndpointArray(endpoints);
    }
View Full Code Here

     * @throws JBIException
     */
    public InternalEndpoint registerInternalEndpoint(ComponentContextImpl provider, QName serviceName, String endpointName) throws JBIException {
        // Create endpoint
        String key = getKey(serviceName, endpointName);
        InternalEndpoint registered = (InternalEndpoint) internalEndpoints.get(key);
        // Check if the endpoint has already been activated by another component
        if (registered != null && registered.isLocal()) {
            throw new JBIException("An internal endpoint for service " + serviceName + " and endpoint " + endpointName + " is already registered");
        }       
        // Create a new endpoint
        InternalEndpoint serviceEndpoint = new InternalEndpoint(provider.getComponentNameSpace(), endpointName, serviceName);
        // Get interface from activationSpec
        if (provider.getActivationSpec().getInterfaceName() != null) {
            serviceEndpoint.addInterface(provider.getActivationSpec().getInterfaceName());
        }
        // Get interfaces
        for (Iterator it = endpointProcessors.iterator(); it.hasNext();) {
            EndpointProcessor p = (EndpointProcessor) it.next();
            p.process(serviceEndpoint);
        }
        // Set remote namespaces
        if (registered != null) {
            InternalEndpoint[] remote = registered.getRemoteEndpoints();
            for (int i = 0; i < remote.length; i++) {
                serviceEndpoint.addRemoteEndpoint(remote[i]);
            }
        }
        // Register endpoint
        internalEndpoints.put(key, serviceEndpoint);
        registerEndpoint(serviceEndpoint);
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.servicedesc.InternalEndpoint

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.