Package javax.jbi.servicedesc

Examples of javax.jbi.servicedesc.ServiceEndpoint


        if (logger.isDebugEnabled()) {
            logger.debug("Retrieving proxied endpoint definition");
        }
        try {
            ComponentContext ctx = this.serviceUnit.getComponent().getComponentContext();
            ServiceEndpoint ep = null;
            if (targetService != null && targetEndpoint != null) {
                ep = ctx.getEndpoint(targetService, targetEndpoint);
                if (ep == null && logger.isDebugEnabled()) {
                    logger.debug("Could not retrieve endpoint targetService/targetEndpoint");
                }
View Full Code Here


     */
    public void deactivate() throws Exception {
        if (activated != null) {
            ComponentContext ctx = this.serviceUnit.getComponent().getComponentContext();
            if (getRole() == Role.PROVIDER) {
                ServiceEndpoint ep = activated;
                activated = null;
                ctx.deactivateEndpoint(ep);
            } else {
                ServiceEndpoint ep = activated;
                activated = null;
                ctx.deregisterExternalEndpoint(ep);
            }
        }
        processor.stop();
View Full Code Here

    protected abstract JBIException createServiceUnavailableException();

    protected ServiceEndpoint[] filterEndpoints(ServiceEndpoint[] endpoints, MessageExchange exchange, EndpointFilter filter) {
        int matches = 0;
        for (int i = 0; i < endpoints.length; i++) {
            ServiceEndpoint endpoint = endpoints[i];
            if (filter.evaluate(endpoint, exchange)) {
                matches++;
            else {
                endpoints[i] = null;
            }
        }
        if (matches == endpoints.length) {
            return endpoints;
        } else {
            ServiceEndpoint[] answer = new ServiceEndpoint[matches];
            int j = 0;
            for (int i = 0; i < endpoints.length; i++) {
                ServiceEndpoint endpoint = endpoints[i];
                if (endpoint != null) {
                    answer[j++] = endpoints[i];
                }
            }
            return answer;
View Full Code Here

    public void sendExchangePacket(MessageExchange me) throws JBIException {
        MessageExchangeImpl exchange = (MessageExchangeImpl) me;
        if (exchange.getRole() == Role.PROVIDER && exchange.getDestinationId() == null) {
            resolveAddress(exchange);
            ServiceEndpoint se = exchange.getEndpoint();
            if (se != null) {
                Set<Principal> acls = authorizationMap.getAcls(se, me.getOperation());
                if (!acls.contains(GroupPrincipal.ANY)) {
                    Subject subject = exchange.getMessage("in").getSecuritySubject();
                    if (subject == null) {
View Full Code Here

            if (endpointName != null) {
                boolean endpointSet = false;
                LOG.debug("default destination endpointName for " + componentName + " = " + endpointName);
                if (serviceName != null && endpointName != null) {
                    endpointName = endpointName.trim();
                    ServiceEndpoint endpoint = container.getRegistry().getEndpoint(serviceName, endpointName);
                    if (endpoint != null) {
                        result.setEndpoint(endpoint);
                        LOG.info("Set default destination endpoint for " + componentName + " to " + endpoint);
                        endpointSet = true;
                    }
View Full Code Here

        exchange.setOperation((QName) context.getProperty(Context.OPERATION));
        if (context.getProperty(Context.ENDPOINT) != null) {
            ComponentContext componentContext = endpoint.getServiceUnit().getComponent().getComponentContext();
            QName serviceName = (QName) context.getProperty(Context.SERVICE);
            String endpointName = (String) context.getProperty(Context.ENDPOINT);
            ServiceEndpoint se = componentContext.getEndpoint(serviceName, endpointName);
            if (se != null) {
                exchange.setEndpoint(se);
            }
        }
        NormalizedMessage inMessage = exchange.createMessage();
View Full Code Here

        String endpointName = (String) context.getProperty(Context.ENDPOINT);
        ComponentContext componentContext = endpoint.getServiceUnit().getComponent().getComponentContext();
        QName bodyName = context.getInMessage().getBodyName();
       
        // Find target endpoint
        ServiceEndpoint se = null;
        if (serviceName != null && endpointName != null) {
            se = componentContext.getEndpoint(serviceName, endpointName);
        }
        if (se == null && interfaceName != null) {
            ServiceEndpoint[] ses = componentContext.getEndpoints(interfaceName);
View Full Code Here

        container.start();
       
        EchoComponent component = new EchoComponent();
        component.setService(new QName("http://foo.bar.com", "myService"));
        container.activateComponent(component, "component");
        ServiceEndpoint ep = component.getContext().activateEndpoint(new QName("http://foo.bar.com", "myService"), "myEndpoint");
        DocumentFragment epr = ep.getAsReference(null);
        ServiceEndpoint ep2 = component.getContext().resolveEndpointReference(epr);
        assertSame(ep, ep2);
    }
View Full Code Here

        container.start();
       
        EchoComponent component = new EchoComponent();
        component.setService(new QName("http://foo.bar.com", "myService"));
        container.activateComponent(component, "component");
        ServiceEndpoint ep = component.getContext().activateEndpoint(new QName("http://foo.bar.com", "myService"), "myEndpoint");
        DocumentFragment epr = URIResolver.createWSAEPR("endpoint:http://foo.bar.com/myService/myEndpoint");
        ServiceEndpoint ep2 = component.getContext().resolveEndpointReference(epr);
        assertSame(ep, ep2);
    }
View Full Code Here

        if (me.getStatus() == ExchangeStatus.ERROR) {
            me.setStatus(ExchangeStatus.DONE);
            getContext().getDeliveryChannel().send(me);
        }
        try {
            ServiceEndpoint se = me.getEndpoint();
            Service service = null;
            for (Iterator it = serviceUnits.values().iterator(); it.hasNext();) {
                XFireServiceUnit su = (XFireServiceUnit) it.next();
                Service s = su.getService(se.getServiceName(), se.getEndpointName());
                if (s != null) {
                    service = s;
                    break;
                }
            }
View Full Code Here

TOP

Related Classes of javax.jbi.servicedesc.ServiceEndpoint

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.