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);
}
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());
}
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);
}
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);
}
}
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);
}
}
Aggregations