Examples of InternalEndpoint


Examples of org.apache.servicemix.nmr.api.internal.InternalEndpoint

        ServiceAssemblyImpl sa = createServiceAssembly();
       
        AssemblyReferencesListener listener = new AssemblyReferencesListener();
        listener.setAssembly(sa);
       
        InternalEndpoint endpoint = new InternalEndpointWrapper(new EndpointImpl(ServiceHelper.createMap(Endpoint.ENDPOINT_NAME, "endpoint")),
                                                                ServiceHelper.createMap(Endpoint.ENDPOINT_NAME, "internal-endpoint"));
        listener.endpointRegistered(endpoint);
        listener.setAssembly(null);
       
        InternalExchange exchange = new ExchangeImpl(Pattern.InOnly);
View Full Code Here

Examples of org.apache.servicemix.nmr.api.internal.InternalEndpoint

     * In an OSGi world, this would be performed automatically by a ServiceTracker.
     *
     * @param endpoint the endpoint to unregister
     */
    public void unregister(Endpoint endpoint, Map<String, ?> properties) {
        InternalEndpoint wrapper;
        if (endpoint instanceof InternalEndpoint) {
            wrapper = (InternalEndpoint) endpoint;
            if (wrapper != null) {
                endpoint = wrappers.remove(wrapper);
                if (endpoint != null) {
                    endpoints.remove(endpoint);
                }
            }
        } else {
            wrapper = endpoints.remove(endpoint);
            if (wrapper != null) {
                wrappers.remove(wrapper);
            }
        }
        if (wrapper != null) {
            wrapper.getChannel().close();
            registry.unregister(wrapper, properties);
            for (EndpointListener listener : nmr.getListenerRegistry().getListeners(EndpointListener.class)) {
                listener.endpointUnregistered(wrapper);
            }
        }
View Full Code Here

Examples of org.apache.servicemix.nmr.api.internal.InternalEndpoint

     *
     * @param endpoint the service for which to retrieve metadata
     * @return the metadata associated with the=is endpoint
     */
    public Map<String, ?> getProperties(Endpoint endpoint) {
        InternalEndpoint wrapper;
        if (endpoint instanceof InternalEndpoint) {
            wrapper = (InternalEndpoint) endpoint;
        } else {
            wrapper = endpoints.get(endpoint);
        }
View Full Code Here

Examples of org.apache.servicemix.nmr.api.internal.InternalEndpoint

    public Iterable<InternalEndpoint> choose(EndpointRegistry registry) {
        List<InternalEndpoint> result = matches;
        if (this.matches == null || this.registry != registry) {
            result = new ArrayList<InternalEndpoint>();
            for (Endpoint ep : registry.query(null)) {
                InternalEndpoint iep = (InternalEndpoint) ep;
                if (Boolean.valueOf((String) iep.getMetaData().get(Endpoint.UNTARGETABLE))) {
                    continue;
                }
                if (match(registry, iep)) {
                    result.add(iep);
                }
View Full Code Here

Examples of org.apache.servicemix.nmr.api.internal.InternalEndpoint

     * Dispatch the Exchange using this flow.
     *
     * @param exchange the exchange to dispatch
     */
    public void dispatch(InternalExchange exchange) {
        InternalEndpoint endpoint = exchange.getRole() == Role.Consumer ? exchange.getDestination()
                : exchange.getSource();
        endpoint.getChannel().deliver(exchange);
    }
View Full Code Here

Examples of org.apache.servicemix.nmr.api.internal.InternalEndpoint

    public Iterable<InternalEndpoint> choose(EndpointRegistry registry) {
        List<InternalEndpoint> result = matches;
        if (result == null || this.registry != registry) {
            result = new ArrayList<InternalEndpoint>();
            for (Endpoint ep : registry.query(null)) {
                InternalEndpoint iep = (InternalEndpoint) ep;
                if (Boolean.valueOf((String) iep.getMetaData().get(Endpoint.UNTARGETABLE))) {
                    continue;
                }
                if (match(registry, iep)) {
                    result.add(iep);
                }
View Full Code Here

Examples of org.apache.servicemix.nmr.api.internal.InternalEndpoint

    public synchronized Iterable<InternalEndpoint> choose(EndpointRegistry registry) {
        List<InternalEndpoint> result = matches;
        if (result == null || this.registry != registry) {
            result = new ArrayList<InternalEndpoint>();
            for (Endpoint ep : registry.query(null)) {
                InternalEndpoint iep = (InternalEndpoint) ep;
                if (Boolean.valueOf((String) iep.getMetaData().get(Endpoint.UNTARGETABLE))) {
                    continue;
                }
                if (filter.match(iep)) {
                    result.add(iep);
                }
View Full Code Here

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

Examples of org.servicemix.jbi.servicedesc.InternalEndpoint

     * @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

Examples of org.servicemix.jbi.servicedesc.InternalEndpoint

     * @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
TOP
Copyright © 2018 www.massapi.com. 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.