ServiceChannelWSImplpublic class ServiceChannelWSImpl extends Object
Fields Summary |
---|
private static final Logger | logger | private WebServiceContext | wsContext |
Methods Summary |
---|
public void | closeChannel(int channelId)
final ChannelContext serviceChannelContext = getChannelContext();
final ServerConnectionSession connectionSession = (ServerConnectionSession) serviceChannelContext.getConnectionSession();
if (connectionSession.findWSServiceContextByChannelId(channelId) != null) {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, MessagesMessages.WSTCP_1142_SOAPTCP_CHANNEL_CLOSE(connectionSession.hashCode(), channelId));
}
connectionSession.deregisterChannel(channelId);
} else {
if (logger.isLoggable(Level.WARNING)) {
logger.log(Level.WARNING, MessagesMessages.WSTCP_0035_UNKNOWN_CHANNEL_UD("Session: " + connectionSession.hashCode() + " Channel-id: " + channelId));
}
throw new ServiceChannelException(ServiceChannelErrorCode.UNKNOWN_CHANNEL_ID, MessagesMessages.WSTCP_0035_UNKNOWN_CHANNEL_UD(channelId));
}
| private com.sun.xml.ws.transport.tcp.server.WSTCPAdapterRegistry | getAdapterRegistry()
final MessageContext messageContext = wsContext.getMessageContext();
return (WSTCPAdapterRegistry) messageContext.get(TCPConstants.ADAPTER_REGISTRY);
| private com.sun.xml.ws.transport.tcp.util.ChannelContext | getChannelContext()
final MessageContext messageContext = wsContext.getMessageContext();
return (ChannelContext) messageContext.get(TCPConstants.CHANNEL_CONTEXT);
| public void | initiateSession()
final ChannelContext serviceChannelContext = getChannelContext();
final ConnectionSession connectionSession = serviceChannelContext.getConnectionSession();
logger.log(Level.FINE, MessagesMessages.WSTCP_1140_SOAPTCP_SESSION_OPEN(connectionSession.hashCode()));
| public int | openChannel(java.lang.String targetWSURI, javax.xml.ws.Holder negotiatedMimeTypes, javax.xml.ws.Holder negotiatedParams)
final ChannelContext serviceChannelContext = getChannelContext();
final ServerConnectionSession connectionSession = (ServerConnectionSession) serviceChannelContext.getConnectionSession();
final WSTCPAdapterRegistry adapterRegistry = getAdapterRegistry();
final WSTCPURI tcpURI = WSTCPURI.parse(targetWSURI);
final TCPAdapter adapter = adapterRegistry.getTarget(tcpURI);
if (adapter == null) throw new ServiceChannelException(ServiceChannelErrorCode.UNKNOWN_ENDPOINT_ADDRESS, MessagesMessages.WSTCP_0034_WS_ENDPOINT_NOT_FOUND(targetWSURI));
final BindingUtils.NegotiatedBindingContent serviceSupportedContent =
BindingUtils.getNegotiatedContentTypesAndParams(adapter.getEndpoint().getBinding());
negotiatedMimeTypes.value.retainAll(serviceSupportedContent.negotiatedMimeTypes);
if (negotiatedMimeTypes.value.size() == 0) {
throw new ServiceChannelException(ServiceChannelErrorCode.CONTENT_NEGOTIATION_FAILED, MessagesMessages.WSTCP_0033_CONTENT_NEGOTIATION_FAILED(targetWSURI, serviceSupportedContent.negotiatedMimeTypes));
}
negotiatedParams.value.retainAll(serviceSupportedContent.negotiatedParams);
int channelId = connectionSession.getNextAvailChannelId();
ChannelSettings channelSettings = new ChannelSettings(negotiatedMimeTypes.value, negotiatedParams.value, channelId, adapter.getEndpoint().getServiceName(), tcpURI);
final ChannelContext openedChannelContext = new ChannelContext(connectionSession, channelSettings);
final SOAPVersion soapVersion = adapter.getEndpoint().getBinding().getSOAPVersion();
final Codec defaultCodec = adapter.getEndpoint().createCodec();
ChannelContext.configureCodec(openedChannelContext, soapVersion, defaultCodec);
connectionSession.registerChannel(openedChannelContext);
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, MessagesMessages.WSTCP_1141_SOAPTCP_CHANNEL_OPEN(connectionSession.hashCode(), openedChannelContext.getChannelId(), targetWSURI));
}
return channelId;
|
|