Package org.apache.servicemix.nmr.api.internal

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) {
View Full Code Here


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

    public synchronized Iterable<InternalEndpoint> choose() {
        if (this.matches == null) {
            List<InternalEndpoint> eps = new ArrayList<InternalEndpoint>();
            for (Endpoint ep : registry.query((Map<String, ?>) null)) {
                InternalEndpoint iep = (InternalEndpoint) ep;
                if (filter.match(iep)) {
                    eps.add(iep);
                }
            }
            this.matches = eps;
View Full Code Here

        // Intercept exchanges
        if (exchange instanceof InternalExchange
                && exchange.getStatus() == Status.Active && exchange.getRole() == Role.Consumer
                && exchange.getOut(false) == null && exchange.getFault(false) == null) {
            // Filter JBI endpoints
            InternalEndpoint source = ((InternalExchange) exchange).getSource();
            for (ClusterRegistration reg : getServices()) {
                if (reg.match(source)) {
                    exchange.setTarget(getChannel().getNMR().getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, name)));
                    return;
                }
View Full Code Here

     * 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

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

        };
        managementStrategyTracker.open();
        endpointTracker = new ServiceTracker(bundleContext, InternalEndpoint.class.getName(), null) {
            @Override
            public Object addingService(ServiceReference reference) {
                InternalEndpoint endpoint = (InternalEndpoint) super.addingService(reference);
                register(endpoint);
                return endpoint;
            }

            @Override
            public void removedService(ServiceReference reference, Object service) {
                InternalEndpoint endpoint = (InternalEndpoint) service;
                unregister(endpoint);
                super.removedService(reference, service);
            }
        };
        endpointTracker.open();
View Full Code Here

TOP

Related Classes of org.apache.servicemix.nmr.api.internal.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.