Search in sources :

Example 1 with Container

use of com.sun.xml.ws.api.server.Container in project metro-jax-ws by eclipse-ee4j.

the class FiberTest method setUp.

public void setUp() {
    testContainer = new Container() {
    };
    String id = "engine1";
    executor = new SimpleInlineExecutor();
    engine = new Engine(id, testContainer, executor);
    threadPoolEngine = new Engine(id, testContainer);
}
Also used : Container(com.sun.xml.ws.api.server.Container)

Example 2 with Container

use of com.sun.xml.ws.api.server.Container in project metro-jax-ws by eclipse-ee4j.

the class TubelineAssemblerFactoryImplTest method testAlternateConfigFileName.

public void testAlternateConfigFileName() throws Exception {
    final BindingID bindingId = BindingID.SOAP11_HTTP;
    final String ALTERNATE_FILE_NAME = "tubes-config/jaxws-tubes-alternate.xml";
    final Container container = new Container() {

        public <S> S getSPI(Class<S> spiType) {
            if (spiType.isAssignableFrom(MetroConfigName.class)) {
                return spiType.cast(new MetroConfigName() {

                    @Override
                    public String getDefaultFileName() {
                        return ALTERNATE_FILE_NAME;
                    }

                    @Override
                    public String getAppFileName() {
                        return ALTERNATE_FILE_NAME;
                    }
                });
            } else if (spiType.isAssignableFrom(ResourceLoader.class)) {
                return spiType.cast(new TestResourceLoader());
            }
            return null;
        }
    };
    final ClientTubeAssemblerContext jaxwsContext = getClientContext(bindingId, container);
    MetroTubelineAssembler assembler = (MetroTubelineAssembler) getAssembler(bindingId);
    TubelineAssemblyController tubelineAssemblyController = assembler.getTubelineAssemblyController();
    DefaultClientTubelineAssemblyContext context = new DefaultClientTubelineAssemblyContext(jaxwsContext);
    Collection<TubeCreator> tubeCreators = tubelineAssemblyController.getTubeCreators(context);
    assertEquals(2, tubeCreators.size());
}
Also used : ResourceLoader(com.sun.xml.ws.api.ResourceLoader) BindingID(com.sun.xml.ws.api.BindingID) Container(com.sun.xml.ws.api.server.Container) ClientTubeAssemblerContext(com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext)

Example 3 with Container

use of com.sun.xml.ws.api.server.Container in project metro-jax-ws by eclipse-ee4j.

the class TubelineAssemblerFactoryImplTest method testCreateDispatchClientNoConfig.

/**
 * Test client creation with parameters that correspond to a dispatch client
 * with no wsit-client.xml and with no WSDL.
 */
public void testCreateDispatchClientNoConfig() throws Exception {
    final BindingID bindingId = BindingID.SOAP11_HTTP;
    final Container container = MockupMetroConfigLoader.createMockupContainer("tubes-config/jaxws-tubes-default.xml");
    final ClientTubeAssemblerContext context = getClientContext(bindingId, container);
    final Tube tubeline = getAssembler(bindingId).createClient(context);
    assertNotNull(tubeline);
}
Also used : Container(com.sun.xml.ws.api.server.Container) Tube(com.sun.xml.ws.api.pipe.Tube) BindingID(com.sun.xml.ws.api.BindingID) ClientTubeAssemblerContext(com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext)

Example 4 with Container

use of com.sun.xml.ws.api.server.Container in project metro-jax-ws by eclipse-ee4j.

the class DispatchImpl method invokeAsync.

public final Response<T> invokeAsync(T param) {
    Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer());
    try {
        if (LOGGER.isLoggable(Level.FINE)) {
            dumpParam(param, "invokeAsync(T)");
        }
        AsyncInvoker invoker = new DispatchAsyncInvoker(param);
        AsyncResponseImpl<T> ft = new AsyncResponseImpl<>(invoker, null);
        invoker.setReceiver(ft);
        ft.run();
        return ft;
    } finally {
        ContainerResolver.getDefault().exitContainer(old);
    }
}
Also used : Container(com.sun.xml.ws.api.server.Container)

Example 5 with Container

use of com.sun.xml.ws.api.server.Container in project metro-jax-ws by eclipse-ee4j.

the class DispatchImpl method invokeAsync.

public final Future<?> invokeAsync(T param, AsyncHandler<T> asyncHandler) {
    Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer());
    try {
        if (LOGGER.isLoggable(Level.FINE)) {
            dumpParam(param, "invokeAsync(T, AsyncHandler<T>)");
        }
        AsyncInvoker invoker = new DispatchAsyncInvoker(param);
        AsyncResponseImpl<T> ft = new AsyncResponseImpl<>(invoker, asyncHandler);
        invoker.setReceiver(ft);
        invoker.setNonNullAsyncHandlerGiven(asyncHandler != null);
        ft.run();
        return ft;
    } finally {
        ContainerResolver.getDefault().exitContainer(old);
    }
}
Also used : Container(com.sun.xml.ws.api.server.Container)

Aggregations

Container (com.sun.xml.ws.api.server.Container)14 BindingID (com.sun.xml.ws.api.BindingID)4 ClientTubeAssemblerContext (com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext)4 WSBinding (com.sun.xml.ws.api.WSBinding)2 WSEndpointReference (com.sun.xml.ws.api.addressing.WSEndpointReference)2 Packet (com.sun.xml.ws.api.message.Packet)2 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)2 Tube (com.sun.xml.ws.api.pipe.Tube)2 WebServiceException (jakarta.xml.ws.WebServiceException)2 URL (java.net.URL)2 QName (javax.xml.namespace.QName)2 DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)1 ExternalMetadataFeature (com.oracle.webservices.api.databinding.ExternalMetadataFeature)1 Component (com.sun.xml.ws.api.Component)1 ComponentFeature (com.sun.xml.ws.api.ComponentFeature)1 EndpointAddress (com.sun.xml.ws.api.EndpointAddress)1 ResourceLoader (com.sun.xml.ws.api.ResourceLoader)1 WSPortInfo (com.sun.xml.ws.api.client.WSPortInfo)1 Header (com.sun.xml.ws.api.message.Header)1 WSDLModel (com.sun.xml.ws.api.model.wsdl.WSDLModel)1