Package org.servicemix.jbi.servicedesc

Examples of org.servicemix.jbi.servicedesc.InternalEndpoint


        super.shutDown();
        container.getManagementContext().unregisterMBean(this);
    }

    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


     * @return EndPointReference
     * @throws JBIException
     */
    public synchronized ServiceEndpoint activateEndpoint(ComponentContextImpl context, QName serviceName,
            String endpointName) throws JBIException {
        InternalEndpoint result = endpointRegistry.activateEndpoint(context, serviceName, endpointName);
        if (result != null) {
            ComponentConnector cc = componentRegistry.getComponentConnector(result.getComponentNameSpace());
            if (cc != null) {
                fireComponentPacketEvent(cc, ComponentPacketEvent.STATE_CHANGE);
            }
        }
        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);
        if (sei != null) {
            ComponentConnector cc = componentRegistry.getComponentConnector(sei.getComponentNameSpace());
            if (cc != null) {
                fireComponentPacketEvent(cc, ComponentPacketEvent.STATE_CHANGE);
            }
        }
    }
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);
        if (result != null) {
            ComponentConnector cc = componentRegistry.getComponentConnector(result.getComponentNameSpace());
            if (cc != null) {
                fireComponentPacketEvent(cc, ComponentPacketEvent.STATE_CHANGE);
            }
        }
        return result;
View Full Code Here

                        }
                    }
                    else {
                        // We didn't have the interface so we will go after
                        // the service name and endpoint
                        InternalEndpoint endPoint = (InternalEndpoint) container.getRegistry().getEndpoint(
                                consumer.getServiceName(), consumer.getEndpointName());
                        if (endPoint != null) {
                            LocalComponentConnector lcc = (LocalComponentConnector) container.getRegistry()
                                    .getComponentConnector(endPoint.getComponentNameSpace());
                            if (lcc != null) {
                                lcc.getActivationSpec().setDestinationEndpoint(provider.getEndpointName());
                                lcc.getActivationSpec().setDestinationService(provider.getServiceName());
                            }
                            else {
                                throw new DeploymentException(
                                        "Unable to build connections, can't find consumer based on component name space "
                                                + endPoint.getComponentNameSpace());
                            }
                        }
                        else {
                            throw new DeploymentException(
                                    "Unable to build connections, can't find consumer with servicename "
View Full Code Here

     */
    protected boolean dispatchToSubscribers(MessageExchangeImpl exchange) throws JBIException {
        List list = registry.getMatchingSubscriptionEndpoints(exchange);
        if (list != null) {
            for (int i =0;i< list.size(); i++) {
                InternalEndpoint endpoint = (InternalEndpoint)list.get(i);
                dispatchToSubscriber(exchange, endpoint);
            }
        }
        return list != null && !list.isEmpty();
    }
View Full Code Here

            SubscriptionSpec subscription = (SubscriptionSpec) entry.getKey();
            if (subscription.matches(registry,exchange)) {
                if (result == null) {
                    result = new ArrayList();
                }
                InternalEndpoint endpoint = (InternalEndpoint) entry.getValue();
                result.add(endpoint);
            }
        }
        return result;
    }
View Full Code Here

     * @param serviceName
     * @param endpointName
     * @return the endpoint
     */
    public InternalEndpoint activateEndpoint(ComponentContextImpl provider, QName serviceName, String endpointName) {
        InternalEndpoint answer = new InternalEndpoint(provider.getComponentNameSpace(), endpointName, serviceName);
        if (provider.getActivationSpec().getInterfaceName() != null) {
            answer.addInterface(provider.getActivationSpec().getInterfaceName());
        }
        retrieveInterfacesFromDescription(provider, answer);
        activateEndpoint(provider, answer);
        return answer;
    }
View Full Code Here

     */
    public ComponentConnector getComponentConnectorByServiceName(QName serviceName) {
        ComponentConnector result = null;
        Set set = getEndpointsByName(serviceName, getInternalEndpoints());
        if (!set.isEmpty()) {
            InternalEndpoint endpoint = (InternalEndpoint) set.iterator().next();
            result = componentRegistry.getComponentConnector(endpoint.getComponentNameSpace());
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.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.