feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
import com.sun.istack.internal.Nullable;
|
||||
import com.sun.xml.internal.ws.api.EndpointAddress;
|
||||
import com.sun.xml.internal.ws.api.WSBinding;
|
||||
import com.sun.xml.internal.ws.api.WSService;
|
||||
import com.sun.xml.internal.ws.api.client.WSPortInfo;
|
||||
import com.sun.xml.internal.ws.api.model.SEIModel;
|
||||
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
|
||||
import com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext;
|
||||
import com.sun.xml.internal.ws.api.pipe.Codec;
|
||||
import com.sun.xml.internal.ws.api.server.Container;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.policy.PolicyMap;
|
||||
|
||||
/**
|
||||
* The context is a wrapper around the existing JAX-WS {@link ClientTubeAssemblerContext} with additional features
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
class DefaultClientTubelineAssemblyContext extends TubelineAssemblyContextImpl implements ClientTubelineAssemblyContext {
|
||||
|
||||
private final @NotNull ClientTubeAssemblerContext wrappedContext;
|
||||
private final PolicyMap policyMap;
|
||||
private final WSPortInfo portInfo; // TODO: is this really needed?
|
||||
private final WSDLPort wsdlPort;
|
||||
// TODO: replace the PipeConfiguration
|
||||
|
||||
public DefaultClientTubelineAssemblyContext(@NotNull ClientTubeAssemblerContext context) {
|
||||
this.wrappedContext = context;
|
||||
this.wsdlPort = context.getWsdlModel();
|
||||
this.portInfo = context.getPortInfo();
|
||||
this.policyMap = context.getPortInfo().getPolicyMap();
|
||||
}
|
||||
|
||||
public PolicyMap getPolicyMap() {
|
||||
return policyMap;
|
||||
}
|
||||
|
||||
public boolean isPolicyAvailable() {
|
||||
return policyMap != null && !policyMap.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* The created pipeline will be used to serve this port.
|
||||
* Null if the service isn't associated with any port definition in WSDL,
|
||||
* and otherwise non-null.
|
||||
*
|
||||
* Replaces {@link com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext#getWsdlModel()}
|
||||
*/
|
||||
public WSDLPort getWsdlPort() {
|
||||
return wsdlPort;
|
||||
}
|
||||
|
||||
public WSPortInfo getPortInfo() {
|
||||
return portInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* The endpoint address. Always non-null. This parameter is taken separately
|
||||
* from {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort} (even though there's {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort#getAddress()})
|
||||
* because sometimes WSDL is not available.
|
||||
*/
|
||||
public @NotNull EndpointAddress getAddress() {
|
||||
return wrappedContext.getAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* The pipeline is created for this {@link com.sun.xml.internal.ws.api.WSService}.
|
||||
* Always non-null. (To be precise, the newly created pipeline
|
||||
* is owned by a proxy or a dispatch created from this {@link com.sun.xml.internal.ws.api.WSService}.)
|
||||
*/
|
||||
public @NotNull WSService getService() {
|
||||
return wrappedContext.getService();
|
||||
}
|
||||
|
||||
/**
|
||||
* The binding of the new pipeline to be created.
|
||||
*/
|
||||
public @NotNull WSBinding getBinding() {
|
||||
return wrappedContext.getBinding();
|
||||
}
|
||||
|
||||
/**
|
||||
* The created pipeline will use seiModel to get java concepts for the endpoint
|
||||
*
|
||||
* @return Null if the service doesn't have SEI model e.g. Dispatch,
|
||||
* and otherwise non-null.
|
||||
*/
|
||||
public @Nullable SEIModel getSEIModel() {
|
||||
return wrappedContext.getSEIModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Container in which the client is running
|
||||
*
|
||||
* @return Container in which client is running
|
||||
*/
|
||||
public Container getContainer() {
|
||||
return wrappedContext.getContainer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link Codec} that is set by {@link #setCodec} or the default codec
|
||||
* based on the binding.
|
||||
*
|
||||
* @return codec to be used for web service requests
|
||||
*/
|
||||
public @NotNull Codec getCodec() {
|
||||
return wrappedContext.getCodec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Interception point to change {@link Codec} during {@link com.sun.xml.internal.ws.api.pipe.Tube}line assembly. The
|
||||
* new codec will be used by jax-ws client runtime for encoding/decoding web service
|
||||
* request/response messages. The new codec should be used by the transport tubes.
|
||||
*
|
||||
* <p>
|
||||
* the codec should correctly implement {@link Codec#copy} since it is used while
|
||||
* serving requests concurrently.
|
||||
*
|
||||
* @param codec codec to be used for web service requests
|
||||
*/
|
||||
public void setCodec(@NotNull Codec codec) {
|
||||
wrappedContext.setCodec(codec);
|
||||
}
|
||||
|
||||
public ClientTubeAssemblerContext getWrappedContext() {
|
||||
return wrappedContext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
import com.sun.istack.internal.Nullable;
|
||||
import com.sun.xml.internal.ws.api.model.SEIModel;
|
||||
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
|
||||
import com.sun.xml.internal.ws.api.pipe.Codec;
|
||||
import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext;
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.api.server.WSEndpoint;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.policy.PolicyMap;
|
||||
|
||||
/**
|
||||
* The context is a wrapper around the existing JAX-WS {@link ServerTubeAssemblerContext} with additional features
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
class DefaultServerTubelineAssemblyContext extends TubelineAssemblyContextImpl implements ServerTubelineAssemblyContext {
|
||||
|
||||
private final @NotNull ServerTubeAssemblerContext wrappedContext;
|
||||
private final PolicyMap policyMap;
|
||||
// TODO: add next tube getter/package-private setter
|
||||
// TODO: replace the PipeConfiguration
|
||||
|
||||
public DefaultServerTubelineAssemblyContext(@NotNull ServerTubeAssemblerContext context) {
|
||||
this.wrappedContext = context;
|
||||
this.policyMap = context.getEndpoint().getPolicyMap();
|
||||
}
|
||||
|
||||
public PolicyMap getPolicyMap() {
|
||||
return policyMap;
|
||||
}
|
||||
|
||||
public boolean isPolicyAvailable() {
|
||||
return policyMap != null && !policyMap.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* The created pipeline will use seiModel to get java concepts for the endpoint
|
||||
*
|
||||
* @return Null if the service doesn't have SEI model e.g. Provider endpoints,
|
||||
* and otherwise non-null.
|
||||
*/
|
||||
public @Nullable SEIModel getSEIModel() {
|
||||
return wrappedContext.getSEIModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* The created pipeline will be used to serve this port.
|
||||
*
|
||||
* @return Null if the service isn't associated with any port definition in WSDL,
|
||||
* and otherwise non-null.
|
||||
*/
|
||||
public @Nullable WSDLPort getWsdlPort() {
|
||||
return wrappedContext.getWsdlModel();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* The created pipeline is used to serve this {@link com.sun.xml.internal.ws.api.server.WSEndpoint}.
|
||||
* Specifically, its {@link com.sun.xml.internal.ws.api.WSBinding} should be of interest to many
|
||||
* {@link com.sun.xml.internal.ws.api.pipe.Pipe}s.
|
||||
* @return Always non-null.
|
||||
*/
|
||||
public @NotNull WSEndpoint getEndpoint() {
|
||||
return wrappedContext.getEndpoint();
|
||||
}
|
||||
|
||||
/**
|
||||
* The last {@link com.sun.xml.internal.ws.api.pipe.Pipe} in the pipeline. The assembler is expected to put
|
||||
* additional {@link com.sun.xml.internal.ws.api.pipe.Pipe}s in front of it.
|
||||
*
|
||||
* <p>
|
||||
* (Just to give you the idea how this is used, normally the terminal pipe
|
||||
* is the one that invokes the user application or {@link javax.xml.ws.Provider}.)
|
||||
*
|
||||
* @return always non-null terminal pipe
|
||||
*/
|
||||
public @NotNull Tube getTerminalTube() {
|
||||
return wrappedContext.getTerminalTube();
|
||||
}
|
||||
|
||||
/**
|
||||
* If this server pipeline is known to be used for serving synchronous transport,
|
||||
* then this method returns true. This can be potentially use as an optimization
|
||||
* hint, since often synchronous versions are cheaper to execute than asycnhronous
|
||||
* versions.
|
||||
*/
|
||||
public boolean isSynchronous() {
|
||||
return wrappedContext.isSynchronous();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link Codec} that is set by {@link #setCodec} or the default codec
|
||||
* based on the binding. The codec is a full codec that is responsible for
|
||||
* encoding/decoding entire protocol message(for e.g: it is responsible to
|
||||
* encode/decode entire MIME messages in SOAP binding)
|
||||
*
|
||||
* @return codec to be used for web service requests
|
||||
* @see {@link com.sun.xml.internal.ws.api.pipe.Codecs}
|
||||
*/
|
||||
public @NotNull Codec getCodec() {
|
||||
return wrappedContext.getCodec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Interception point to change {@link Codec} during {@link Tube}line assembly. The
|
||||
* new codec will be used by jax-ws server runtime for encoding/decoding web service
|
||||
* request/response messages. {@link WSEndpoint#createCodec()} will return a copy
|
||||
* of this new codec and will be used in the server runtime.
|
||||
*
|
||||
* <p>
|
||||
* The codec is a full codec that is responsible for
|
||||
* encoding/decoding entire protocol message(for e.g: it is responsible to
|
||||
* encode/decode entire MIME messages in SOAP binding)
|
||||
*
|
||||
* <p>
|
||||
* the codec should correctly implement {@link Codec#copy} since it is used while
|
||||
* serving requests concurrently.
|
||||
*
|
||||
* @param codec codec to be used for web service requests
|
||||
* @see {@link com.sun.xml.internal.ws.api.pipe.Codecs}
|
||||
*/
|
||||
public void setCodec(@NotNull Codec codec) {
|
||||
wrappedContext.setCodec(codec);
|
||||
}
|
||||
|
||||
public ServerTubeAssemblerContext getWrappedContext() {
|
||||
return wrappedContext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
import com.sun.istack.internal.logging.Logger;
|
||||
import com.sun.xml.internal.ws.api.ResourceLoader;
|
||||
import com.sun.xml.internal.ws.api.server.Container;
|
||||
import com.sun.xml.internal.ws.resources.TubelineassemblyMessages;
|
||||
import com.sun.xml.internal.ws.runtime.config.MetroConfig;
|
||||
import com.sun.xml.internal.ws.runtime.config.TubeFactoryList;
|
||||
import com.sun.xml.internal.ws.runtime.config.TubelineDefinition;
|
||||
import com.sun.xml.internal.ws.runtime.config.TubelineMapping;
|
||||
import com.sun.xml.internal.ws.util.xml.XmlUtil;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
import javax.xml.ws.WebServiceException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.ReflectPermission;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.security.*;
|
||||
import java.util.PropertyPermission;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* This class is responsible for locating and loading Metro configuration files
|
||||
* (both application jaxws-tubes.xml and default jaxws-tubes-default.xml).
|
||||
* <p/>
|
||||
* Once the configuration is loaded the class is able to resolve which tubeline
|
||||
* configuration belongs to each endpoint or endpoint client. This information is
|
||||
* then used in {@link TubelineAssemblyController} to construct the list of
|
||||
* {@link TubeCreator} objects that are used in the actual tubeline construction.
|
||||
*
|
||||
* @author Marek Potociar <marek.potociar at sun.com>
|
||||
*/
|
||||
// TODO Move the logic of this class directly into MetroConfig class.
|
||||
class MetroConfigLoader {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(MetroConfigLoader.class);
|
||||
|
||||
private MetroConfigName defaultTubesConfigNames;
|
||||
|
||||
private static interface TubeFactoryListResolver {
|
||||
|
||||
TubeFactoryList getFactories(TubelineDefinition td);
|
||||
}
|
||||
|
||||
private static final TubeFactoryListResolver ENDPOINT_SIDE_RESOLVER = new TubeFactoryListResolver() {
|
||||
|
||||
public TubeFactoryList getFactories(TubelineDefinition td) {
|
||||
return (td != null) ? td.getEndpointSide() : null;
|
||||
}
|
||||
};
|
||||
private static final TubeFactoryListResolver CLIENT_SIDE_RESOLVER = new TubeFactoryListResolver() {
|
||||
|
||||
public TubeFactoryList getFactories(TubelineDefinition td) {
|
||||
return (td != null) ? td.getClientSide() : null;
|
||||
}
|
||||
};
|
||||
//
|
||||
private MetroConfig defaultConfig;
|
||||
private URL defaultConfigUrl;
|
||||
private MetroConfig appConfig;
|
||||
private URL appConfigUrl;
|
||||
|
||||
MetroConfigLoader(Container container, MetroConfigName defaultTubesConfigNames) {
|
||||
this.defaultTubesConfigNames = defaultTubesConfigNames;
|
||||
ResourceLoader spiResourceLoader = null;
|
||||
if (container != null) {
|
||||
spiResourceLoader = container.getSPI(ResourceLoader.class);
|
||||
}
|
||||
// if spi resource can't load resource, default (MetroConfigUrlLoader) is used;
|
||||
// it searches the classpath, so it would be most probably used
|
||||
// when using jaxws- or metro-defaults from jaxws libraries
|
||||
init(container, spiResourceLoader, new MetroConfigUrlLoader(container));
|
||||
}
|
||||
|
||||
private void init(Container container, ResourceLoader... loaders) {
|
||||
|
||||
String appFileName = null;
|
||||
String defaultFileName = null;
|
||||
if (container != null) {
|
||||
MetroConfigName mcn = container.getSPI(MetroConfigName.class);
|
||||
if (mcn != null) {
|
||||
appFileName = mcn.getAppFileName();
|
||||
defaultFileName = mcn.getDefaultFileName();
|
||||
}
|
||||
}
|
||||
if (appFileName == null) {
|
||||
appFileName = defaultTubesConfigNames.getAppFileName();
|
||||
}
|
||||
|
||||
if (defaultFileName == null) {
|
||||
defaultFileName = defaultTubesConfigNames.getDefaultFileName();
|
||||
}
|
||||
this.defaultConfigUrl = locateResource(defaultFileName, loaders);
|
||||
if (defaultConfigUrl == null) {
|
||||
throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0001_DEFAULT_CFG_FILE_NOT_FOUND(defaultFileName)));
|
||||
}
|
||||
|
||||
LOGGER.config(TubelineassemblyMessages.MASM_0002_DEFAULT_CFG_FILE_LOCATED(defaultFileName, defaultConfigUrl));
|
||||
this.defaultConfig = MetroConfigLoader.loadMetroConfig(defaultConfigUrl);
|
||||
if (defaultConfig == null) {
|
||||
throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0003_DEFAULT_CFG_FILE_NOT_LOADED(defaultFileName)));
|
||||
}
|
||||
if (defaultConfig.getTubelines() == null) {
|
||||
throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0004_NO_TUBELINES_SECTION_IN_DEFAULT_CFG_FILE(defaultFileName)));
|
||||
}
|
||||
if (defaultConfig.getTubelines().getDefault() == null) {
|
||||
throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0005_NO_DEFAULT_TUBELINE_IN_DEFAULT_CFG_FILE(defaultFileName)));
|
||||
}
|
||||
|
||||
this.appConfigUrl = locateResource(appFileName, loaders);
|
||||
if (appConfigUrl != null) {
|
||||
LOGGER.config(TubelineassemblyMessages.MASM_0006_APP_CFG_FILE_LOCATED(appConfigUrl));
|
||||
this.appConfig = MetroConfigLoader.loadMetroConfig(appConfigUrl);
|
||||
} else {
|
||||
LOGGER.config(TubelineassemblyMessages.MASM_0007_APP_CFG_FILE_NOT_FOUND());
|
||||
this.appConfig = null;
|
||||
}
|
||||
}
|
||||
|
||||
TubeFactoryList getEndpointSideTubeFactories(URI endpointReference) {
|
||||
return getTubeFactories(endpointReference, ENDPOINT_SIDE_RESOLVER);
|
||||
}
|
||||
|
||||
TubeFactoryList getClientSideTubeFactories(URI endpointReference) {
|
||||
return getTubeFactories(endpointReference, CLIENT_SIDE_RESOLVER);
|
||||
}
|
||||
|
||||
private TubeFactoryList getTubeFactories(URI endpointReference, TubeFactoryListResolver resolver) {
|
||||
if (appConfig != null && appConfig.getTubelines() != null) {
|
||||
for (TubelineMapping mapping : appConfig.getTubelines().getTubelineMappings()) {
|
||||
if (mapping.getEndpointRef().equals(endpointReference.toString())) {
|
||||
TubeFactoryList list = resolver.getFactories(getTubeline(appConfig, resolveReference(mapping.getTubelineRef())));
|
||||
if (list != null) {
|
||||
return list;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (appConfig.getTubelines().getDefault() != null) {
|
||||
TubeFactoryList list = resolver.getFactories(getTubeline(appConfig, resolveReference(appConfig.getTubelines().getDefault())));
|
||||
if (list != null) {
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (TubelineMapping mapping : defaultConfig.getTubelines().getTubelineMappings()) {
|
||||
if (mapping.getEndpointRef().equals(endpointReference.toString())) {
|
||||
TubeFactoryList list = resolver.getFactories(getTubeline(defaultConfig, resolveReference(mapping.getTubelineRef())));
|
||||
if (list != null) {
|
||||
return list;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resolver.getFactories(getTubeline(defaultConfig, resolveReference(defaultConfig.getTubelines().getDefault())));
|
||||
}
|
||||
|
||||
TubelineDefinition getTubeline(MetroConfig config, URI tubelineDefinitionUri) {
|
||||
if (config != null && config.getTubelines() != null) {
|
||||
for (TubelineDefinition td : config.getTubelines().getTubelineDefinitions()) {
|
||||
if (td.getName().equals(tubelineDefinitionUri.getFragment())) {
|
||||
return td;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static URI resolveReference(String reference) {
|
||||
try {
|
||||
return new URI(reference);
|
||||
} catch (URISyntaxException ex) {
|
||||
throw LOGGER.logSevereException(new WebServiceException(TubelineassemblyMessages.MASM_0008_INVALID_URI_REFERENCE(reference), ex));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static URL locateResource(String resource, ResourceLoader loader) {
|
||||
if (loader == null) return null;
|
||||
|
||||
try {
|
||||
return loader.getResource(resource);
|
||||
} catch (MalformedURLException ex) {
|
||||
LOGGER.severe(TubelineassemblyMessages.MASM_0009_CANNOT_FORM_VALID_URL(resource), ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static URL locateResource(String resource, ResourceLoader[] loaders) {
|
||||
|
||||
for (ResourceLoader loader : loaders) {
|
||||
URL url = locateResource(resource, loader);
|
||||
if (url != null) {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
|
||||
MetroConfig result = null;
|
||||
try {
|
||||
JAXBContext jaxbContext = createJAXBContext();
|
||||
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
|
||||
XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
|
||||
final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
|
||||
result = configElement.getValue();
|
||||
} catch (Exception e) {
|
||||
LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JAXBContext createJAXBContext() throws Exception {
|
||||
if (isJDKInternal()) {
|
||||
// since jdk classes are repackaged, extra privilege is necessary to create JAXBContext
|
||||
return AccessController.doPrivileged(
|
||||
new PrivilegedExceptionAction<JAXBContext>() {
|
||||
@Override
|
||||
public JAXBContext run() throws Exception {
|
||||
return JAXBContext.newInstance(MetroConfig.class.getPackage().getName());
|
||||
}
|
||||
}, createSecurityContext()
|
||||
);
|
||||
} else {
|
||||
// usage from JAX-WS/Metro/Glassfish
|
||||
return JAXBContext.newInstance(MetroConfig.class.getPackage().getName());
|
||||
}
|
||||
}
|
||||
|
||||
private static AccessControlContext createSecurityContext() {
|
||||
PermissionCollection perms = new Permissions();
|
||||
perms.add(new RuntimePermission("accessClassInPackage.com" + ".sun.xml.internal.ws.runtime.config")); // avoid repackaging
|
||||
perms.add(new ReflectPermission("suppressAccessChecks"));
|
||||
return new AccessControlContext(
|
||||
new ProtectionDomain[]{
|
||||
new ProtectionDomain(null, perms),
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean isJDKInternal() {
|
||||
// avoid "string repackaging"
|
||||
return MetroConfigLoader.class.getName().startsWith("com." + "sun.xml.internal.ws");
|
||||
}
|
||||
|
||||
private static class MetroConfigUrlLoader extends ResourceLoader {
|
||||
|
||||
Container container; // TODO remove the field together with the code path using it (see below)
|
||||
ResourceLoader parentLoader;
|
||||
|
||||
MetroConfigUrlLoader(ResourceLoader parentLoader) {
|
||||
this.parentLoader = parentLoader;
|
||||
}
|
||||
|
||||
MetroConfigUrlLoader(Container container) {
|
||||
this((container != null) ? container.getSPI(ResourceLoader.class) : null);
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getResource(String resource) throws MalformedURLException {
|
||||
LOGGER.entering(resource);
|
||||
URL resourceUrl = null;
|
||||
try {
|
||||
if (parentLoader != null) {
|
||||
if (LOGGER.isLoggable(Level.FINE)) {
|
||||
LOGGER.fine(TubelineassemblyMessages.MASM_0011_LOADING_RESOURCE(resource, parentLoader));
|
||||
}
|
||||
|
||||
resourceUrl = parentLoader.getResource(resource);
|
||||
}
|
||||
|
||||
if (resourceUrl == null) {
|
||||
resourceUrl = loadViaClassLoaders("com/sun/xml/internal/ws/assembler/" + resource);
|
||||
}
|
||||
|
||||
if (resourceUrl == null && container != null) {
|
||||
// TODO: we should remove this code path, the config file should be loaded using ResourceLoader only
|
||||
resourceUrl = loadFromServletContext(resource);
|
||||
}
|
||||
|
||||
return resourceUrl;
|
||||
} finally {
|
||||
LOGGER.exiting(resourceUrl);
|
||||
}
|
||||
}
|
||||
|
||||
private static URL loadViaClassLoaders(final String resource) {
|
||||
URL resourceUrl = tryLoadFromClassLoader(resource, Thread.currentThread().getContextClassLoader());
|
||||
if (resourceUrl == null) {
|
||||
resourceUrl = tryLoadFromClassLoader(resource, MetroConfigLoader.class.getClassLoader());
|
||||
if (resourceUrl == null) {
|
||||
return ClassLoader.getSystemResource(resource);
|
||||
}
|
||||
}
|
||||
|
||||
return resourceUrl;
|
||||
}
|
||||
|
||||
private static URL tryLoadFromClassLoader(final String resource, final ClassLoader loader) {
|
||||
return (loader != null) ? loader.getResource(resource) : null;
|
||||
}
|
||||
|
||||
private URL loadFromServletContext(String resource) throws RuntimeException {
|
||||
Object context = null;
|
||||
try {
|
||||
final Class<?> contextClass = Class.forName("javax.servlet.ServletContext");
|
||||
context = container.getSPI(contextClass);
|
||||
if (context != null) {
|
||||
if (LOGGER.isLoggable(Level.FINE)) {
|
||||
LOGGER.fine(TubelineassemblyMessages.MASM_0012_LOADING_VIA_SERVLET_CONTEXT(resource, context));
|
||||
}
|
||||
try {
|
||||
final Method method = context.getClass().getMethod("getResource", String.class);
|
||||
final Object result = method.invoke(context, "/WEB-INF/" + resource);
|
||||
return URL.class.cast(result);
|
||||
} catch (Exception e) {
|
||||
throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0013_ERROR_INVOKING_SERVLET_CONTEXT_METHOD("getResource()")), e);
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
if (LOGGER.isLoggable(Level.FINE)) {
|
||||
LOGGER.fine(TubelineassemblyMessages.MASM_0014_UNABLE_TO_LOAD_CLASS("javax.servlet.ServletContext"));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
/**
|
||||
* This interface is used to get the file name used for the metro configuration file.
|
||||
* This allows multiple configurations of metro in a single VM.
|
||||
*
|
||||
* @author Bob Naugle
|
||||
*/
|
||||
public interface MetroConfigName {
|
||||
public String getDefaultFileName();
|
||||
|
||||
public String getAppFileName();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
/**
|
||||
* TODO: Write some description here ...
|
||||
*
|
||||
* @author Miroslav Kos (miroslav.kos at oracle.com)
|
||||
*/
|
||||
public class MetroConfigNameImpl implements MetroConfigName {
|
||||
|
||||
private final String defaultFileName;
|
||||
private final String appFileName;
|
||||
|
||||
public MetroConfigNameImpl(String defaultFileName, String appFileName) {
|
||||
this.defaultFileName = defaultFileName;
|
||||
this.appFileName = appFileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultFileName() {
|
||||
return defaultFileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppFileName() {
|
||||
return appFileName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
import com.sun.istack.internal.logging.Logger;
|
||||
import com.sun.xml.internal.ws.api.BindingID;
|
||||
import com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext;
|
||||
import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext;
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.api.pipe.TubelineAssembler;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubelineAssemblyDecorator;
|
||||
import com.sun.xml.internal.ws.dump.LoggingDumpTube;
|
||||
import com.sun.xml.internal.ws.resources.TubelineassemblyMessages;
|
||||
import com.sun.xml.internal.ws.util.ServiceFinder;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* TODO: Write some description here ...
|
||||
*
|
||||
* @author Miroslav Kos (miroslav.kos at oracle.com)
|
||||
*/
|
||||
public class MetroTubelineAssembler implements TubelineAssembler {
|
||||
|
||||
private static final String COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE = "com.sun.metro.soap.dump";
|
||||
public static final MetroConfigNameImpl JAXWS_TUBES_CONFIG_NAMES = new MetroConfigNameImpl("jaxws-tubes-default.xml", "jaxws-tubes.xml");
|
||||
|
||||
private static enum Side {
|
||||
|
||||
Client("client"),
|
||||
Endpoint("endpoint");
|
||||
private final String name;
|
||||
|
||||
private Side(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
private static class MessageDumpingInfo {
|
||||
|
||||
final boolean dumpBefore;
|
||||
final boolean dumpAfter;
|
||||
final Level logLevel;
|
||||
|
||||
MessageDumpingInfo(boolean dumpBefore, boolean dumpAfter, Level logLevel) {
|
||||
this.dumpBefore = dumpBefore;
|
||||
this.dumpAfter = dumpAfter;
|
||||
this.logLevel = logLevel;
|
||||
}
|
||||
}
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(MetroTubelineAssembler.class);
|
||||
private final BindingID bindingId;
|
||||
private final TubelineAssemblyController tubelineAssemblyController;
|
||||
|
||||
public MetroTubelineAssembler(final BindingID bindingId, MetroConfigName metroConfigName) {
|
||||
this.bindingId = bindingId;
|
||||
this.tubelineAssemblyController = new TubelineAssemblyController(metroConfigName);
|
||||
}
|
||||
|
||||
TubelineAssemblyController getTubelineAssemblyController() {
|
||||
return tubelineAssemblyController;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Tube createClient(@NotNull ClientTubeAssemblerContext jaxwsContext) {
|
||||
if (LOGGER.isLoggable(Level.FINER)) {
|
||||
LOGGER.finer("Assembling client-side tubeline for WS endpoint: " + jaxwsContext.getAddress().getURI().toString());
|
||||
}
|
||||
|
||||
DefaultClientTubelineAssemblyContext context = createClientContext(jaxwsContext);
|
||||
|
||||
Collection<TubeCreator> tubeCreators = tubelineAssemblyController.getTubeCreators(context);
|
||||
|
||||
for (TubeCreator tubeCreator : tubeCreators) {
|
||||
tubeCreator.updateContext(context);
|
||||
}
|
||||
|
||||
TubelineAssemblyDecorator decorator = TubelineAssemblyDecorator.composite(
|
||||
ServiceFinder.find(TubelineAssemblyDecorator.class, context.getContainer()));
|
||||
|
||||
boolean first = true;
|
||||
for (TubeCreator tubeCreator : tubeCreators) {
|
||||
final MessageDumpingInfo msgDumpInfo = setupMessageDumping(tubeCreator.getMessageDumpPropertyBase(), Side.Client);
|
||||
|
||||
final Tube oldTubelineHead = context.getTubelineHead();
|
||||
LoggingDumpTube afterDumpTube = null;
|
||||
if (msgDumpInfo.dumpAfter) {
|
||||
afterDumpTube = new LoggingDumpTube(msgDumpInfo.logLevel, LoggingDumpTube.Position.After, context.getTubelineHead());
|
||||
context.setTubelineHead(afterDumpTube);
|
||||
}
|
||||
|
||||
if (!context.setTubelineHead(decorator.decorateClient(tubeCreator.createTube(context), context))) { // no new tube has been created
|
||||
if (afterDumpTube != null) {
|
||||
context.setTubelineHead(oldTubelineHead); // removing possible "after" message dumping tube
|
||||
}
|
||||
} else {
|
||||
final String loggedTubeName = context.getTubelineHead().getClass().getName();
|
||||
if (afterDumpTube != null) {
|
||||
afterDumpTube.setLoggedTubeName(loggedTubeName);
|
||||
}
|
||||
|
||||
if (msgDumpInfo.dumpBefore) {
|
||||
final LoggingDumpTube beforeDumpTube = new LoggingDumpTube(msgDumpInfo.logLevel, LoggingDumpTube.Position.Before, context.getTubelineHead());
|
||||
beforeDumpTube.setLoggedTubeName(loggedTubeName);
|
||||
context.setTubelineHead(beforeDumpTube);
|
||||
}
|
||||
}
|
||||
|
||||
if (first) {
|
||||
context.setTubelineHead(decorator.decorateClientTail(context.getTubelineHead(), context));
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
||||
return decorator.decorateClientHead(context.getTubelineHead(), context);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Tube createServer(@NotNull ServerTubeAssemblerContext jaxwsContext) {
|
||||
if (LOGGER.isLoggable(Level.FINER)) {
|
||||
LOGGER.finer("Assembling endpoint tubeline for WS endpoint: " + jaxwsContext.getEndpoint().getServiceName() + "::" + jaxwsContext.getEndpoint().getPortName());
|
||||
}
|
||||
|
||||
DefaultServerTubelineAssemblyContext context = createServerContext(jaxwsContext);
|
||||
|
||||
// FIXME endpoint URI for provider case
|
||||
Collection<TubeCreator> tubeCreators = tubelineAssemblyController.getTubeCreators(context);
|
||||
for (TubeCreator tubeCreator : tubeCreators) {
|
||||
tubeCreator.updateContext(context);
|
||||
}
|
||||
|
||||
TubelineAssemblyDecorator decorator = TubelineAssemblyDecorator.composite(
|
||||
ServiceFinder.find(TubelineAssemblyDecorator.class, context.getEndpoint().getContainer()));
|
||||
|
||||
boolean first = true;
|
||||
for (TubeCreator tubeCreator : tubeCreators) {
|
||||
final MessageDumpingInfo msgDumpInfo = setupMessageDumping(tubeCreator.getMessageDumpPropertyBase(), Side.Endpoint);
|
||||
|
||||
final Tube oldTubelineHead = context.getTubelineHead();
|
||||
LoggingDumpTube afterDumpTube = null;
|
||||
if (msgDumpInfo.dumpAfter) {
|
||||
afterDumpTube = new LoggingDumpTube(msgDumpInfo.logLevel, LoggingDumpTube.Position.After, context.getTubelineHead());
|
||||
context.setTubelineHead(afterDumpTube);
|
||||
}
|
||||
|
||||
if (!context.setTubelineHead(decorator.decorateServer(tubeCreator.createTube(context), context))) { // no new tube has been created
|
||||
if (afterDumpTube != null) {
|
||||
context.setTubelineHead(oldTubelineHead); // removing possible "after" message dumping tube
|
||||
}
|
||||
} else {
|
||||
final String loggedTubeName = context.getTubelineHead().getClass().getName();
|
||||
if (afterDumpTube != null) {
|
||||
afterDumpTube.setLoggedTubeName(loggedTubeName);
|
||||
}
|
||||
|
||||
if (msgDumpInfo.dumpBefore) {
|
||||
final LoggingDumpTube beforeDumpTube = new LoggingDumpTube(msgDumpInfo.logLevel, LoggingDumpTube.Position.Before, context.getTubelineHead());
|
||||
beforeDumpTube.setLoggedTubeName(loggedTubeName);
|
||||
context.setTubelineHead(beforeDumpTube);
|
||||
}
|
||||
}
|
||||
|
||||
if (first) {
|
||||
context.setTubelineHead(decorator.decorateServerTail(context.getTubelineHead(), context));
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
||||
return decorator.decorateServerHead(context.getTubelineHead(), context);
|
||||
}
|
||||
|
||||
private MessageDumpingInfo setupMessageDumping(String msgDumpSystemPropertyBase, Side side) {
|
||||
boolean dumpBefore = false;
|
||||
boolean dumpAfter = false;
|
||||
Level logLevel = Level.INFO;
|
||||
|
||||
// checking common properties
|
||||
Boolean value = getBooleanValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE);
|
||||
if (value != null) {
|
||||
dumpBefore = value.booleanValue();
|
||||
dumpAfter = value.booleanValue();
|
||||
}
|
||||
|
||||
value = getBooleanValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE + ".before");
|
||||
dumpBefore = (value != null) ? value.booleanValue() : dumpBefore;
|
||||
|
||||
value = getBooleanValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE + ".after");
|
||||
dumpAfter = (value != null) ? value.booleanValue() : dumpAfter;
|
||||
|
||||
Level levelValue = getLevelValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE + ".level");
|
||||
if (levelValue != null) {
|
||||
logLevel = levelValue;
|
||||
}
|
||||
|
||||
// narrowing to proper communication side on common properties
|
||||
value = getBooleanValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE + "." + side.toString());
|
||||
if (value != null) {
|
||||
dumpBefore = value.booleanValue();
|
||||
dumpAfter = value.booleanValue();
|
||||
}
|
||||
|
||||
value = getBooleanValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE + "." + side.toString() + ".before");
|
||||
dumpBefore = (value != null) ? value.booleanValue() : dumpBefore;
|
||||
|
||||
value = getBooleanValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE + "." + side.toString() + ".after");
|
||||
dumpAfter = (value != null) ? value.booleanValue() : dumpAfter;
|
||||
|
||||
levelValue = getLevelValue(COMMON_MESSAGE_DUMP_SYSTEM_PROPERTY_BASE + "." + side.toString() + ".level");
|
||||
if (levelValue != null) {
|
||||
logLevel = levelValue;
|
||||
}
|
||||
|
||||
|
||||
// checking general tube-specific properties
|
||||
value = getBooleanValue(msgDumpSystemPropertyBase);
|
||||
if (value != null) {
|
||||
dumpBefore = value.booleanValue();
|
||||
dumpAfter = value.booleanValue();
|
||||
}
|
||||
|
||||
value = getBooleanValue(msgDumpSystemPropertyBase + ".before");
|
||||
dumpBefore = (value != null) ? value.booleanValue() : dumpBefore;
|
||||
|
||||
value = getBooleanValue(msgDumpSystemPropertyBase + ".after");
|
||||
dumpAfter = (value != null) ? value.booleanValue() : dumpAfter;
|
||||
|
||||
levelValue = getLevelValue(msgDumpSystemPropertyBase + ".level");
|
||||
if (levelValue != null) {
|
||||
logLevel = levelValue;
|
||||
}
|
||||
|
||||
// narrowing to proper communication side on tube-specific properties
|
||||
msgDumpSystemPropertyBase += "." + side.toString();
|
||||
|
||||
value = getBooleanValue(msgDumpSystemPropertyBase);
|
||||
if (value != null) {
|
||||
dumpBefore = value.booleanValue();
|
||||
dumpAfter = value.booleanValue();
|
||||
}
|
||||
|
||||
value = getBooleanValue(msgDumpSystemPropertyBase + ".before");
|
||||
dumpBefore = (value != null) ? value.booleanValue() : dumpBefore;
|
||||
|
||||
value = getBooleanValue(msgDumpSystemPropertyBase + ".after");
|
||||
dumpAfter = (value != null) ? value.booleanValue() : dumpAfter;
|
||||
|
||||
levelValue = getLevelValue(msgDumpSystemPropertyBase + ".level");
|
||||
if (levelValue != null) {
|
||||
logLevel = levelValue;
|
||||
}
|
||||
|
||||
return new MessageDumpingInfo(dumpBefore, dumpAfter, logLevel);
|
||||
}
|
||||
|
||||
private Boolean getBooleanValue(String propertyName) {
|
||||
Boolean retVal = null;
|
||||
|
||||
String stringValue = System.getProperty(propertyName);
|
||||
if (stringValue != null) {
|
||||
retVal = Boolean.valueOf(stringValue);
|
||||
LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, retVal));
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
private Level getLevelValue(String propertyName) {
|
||||
Level retVal = null;
|
||||
|
||||
String stringValue = System.getProperty(propertyName);
|
||||
if (stringValue != null) {
|
||||
// if value is not null => property is set, we will try to override the default logging level
|
||||
LOGGER.fine(TubelineassemblyMessages.MASM_0018_MSG_LOGGING_SYSTEM_PROPERTY_SET_TO_VALUE(propertyName, stringValue));
|
||||
try {
|
||||
retVal = Level.parse(stringValue);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
LOGGER.warning(TubelineassemblyMessages.MASM_0019_MSG_LOGGING_SYSTEM_PROPERTY_ILLEGAL_VALUE(propertyName, stringValue), ex);
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// Extension point to change Tubeline Assembly behaviour: override if necessary ...
|
||||
protected DefaultServerTubelineAssemblyContext createServerContext(ServerTubeAssemblerContext jaxwsContext) {
|
||||
return new DefaultServerTubelineAssemblyContext(jaxwsContext);
|
||||
}
|
||||
|
||||
// Extension point to change Tubeline Assembly behaviour: override if necessary ...
|
||||
protected DefaultClientTubelineAssemblyContext createClientContext(ClientTubeAssemblerContext jaxwsContext) {
|
||||
return new DefaultClientTubelineAssemblyContext(jaxwsContext);
|
||||
}
|
||||
|
||||
}
|
||||
105
jdkSrc/jdk8/com/sun/xml/internal/ws/assembler/TubeCreator.java
Normal file
105
jdkSrc/jdk8/com/sun/xml/internal/ws/assembler/TubeCreator.java
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
import com.sun.istack.internal.logging.Logger;
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubelineAssemblyContextUpdater;
|
||||
import com.sun.xml.internal.ws.resources.TubelineassemblyMessages;
|
||||
import com.sun.xml.internal.ws.runtime.config.TubeFactoryConfig;
|
||||
|
||||
/**
|
||||
* Utility class that encapsulates logic of loading TubeFactory
|
||||
* instances and creating Tube instances.
|
||||
*
|
||||
* @author m_potociar
|
||||
*/
|
||||
final class TubeCreator {
|
||||
private static final Logger LOGGER = Logger.getLogger(TubeCreator.class);
|
||||
private final TubeFactory factory;
|
||||
private final String msgDumpPropertyBase;
|
||||
|
||||
TubeCreator(TubeFactoryConfig config, ClassLoader tubeFactoryClassLoader) {
|
||||
String className = config.getClassName();
|
||||
try {
|
||||
Class<?> factoryClass;
|
||||
if (isJDKInternal(className)) {
|
||||
factoryClass = Class.forName(className, true, null);
|
||||
} else {
|
||||
factoryClass = Class.forName(className, true, tubeFactoryClassLoader);
|
||||
}
|
||||
if (TubeFactory.class.isAssignableFrom(factoryClass)) {
|
||||
// We can suppress "unchecked" warning here as we are checking for the correct type in the if statement above
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<TubeFactory> typedClass = (Class<TubeFactory>) factoryClass;
|
||||
this.factory = typedClass.newInstance();
|
||||
this.msgDumpPropertyBase = this.factory.getClass().getName() + ".dump";
|
||||
} else {
|
||||
throw new RuntimeException(TubelineassemblyMessages.MASM_0015_CLASS_DOES_NOT_IMPLEMENT_INTERFACE(factoryClass.getName(), TubeFactory.class.getName()));
|
||||
}
|
||||
} catch (InstantiationException ex) {
|
||||
throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0016_UNABLE_TO_INSTANTIATE_TUBE_FACTORY(className), ex), true);
|
||||
} catch (IllegalAccessException ex) {
|
||||
throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0016_UNABLE_TO_INSTANTIATE_TUBE_FACTORY(className), ex), true);
|
||||
} catch (ClassNotFoundException ex) {
|
||||
throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0017_UNABLE_TO_LOAD_TUBE_FACTORY_CLASS(className), ex), true);
|
||||
}
|
||||
}
|
||||
|
||||
Tube createTube(DefaultClientTubelineAssemblyContext context) {
|
||||
// TODO implement passing init parameters (if any) to the factory
|
||||
return factory.createTube(context);
|
||||
}
|
||||
|
||||
Tube createTube(DefaultServerTubelineAssemblyContext context) {
|
||||
// TODO implement passing init parameters (if any) to the factory
|
||||
return factory.createTube(context);
|
||||
}
|
||||
|
||||
void updateContext(ClientTubelineAssemblyContext context) {
|
||||
if (factory instanceof TubelineAssemblyContextUpdater) {
|
||||
((TubelineAssemblyContextUpdater) factory).prepareContext(context);
|
||||
}
|
||||
}
|
||||
|
||||
void updateContext(DefaultServerTubelineAssemblyContext context) {
|
||||
if (factory instanceof TubelineAssemblyContextUpdater) {
|
||||
((TubelineAssemblyContextUpdater) factory).prepareContext(context);
|
||||
}
|
||||
}
|
||||
|
||||
String getMessageDumpPropertyBase() {
|
||||
return msgDumpPropertyBase;
|
||||
}
|
||||
|
||||
private boolean isJDKInternal(String className) {
|
||||
// avoid repackaging
|
||||
return className.startsWith("com." + "sun.xml.internal.ws");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
import com.sun.istack.internal.logging.Logger;
|
||||
import com.sun.xml.internal.ws.api.pipe.Pipe;
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubelineAssemblyContext;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* A base tubeline assembly context class providing common methods for both
|
||||
* client and server assembly context classes.
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
class TubelineAssemblyContextImpl implements TubelineAssemblyContext {
|
||||
private static final Logger LOGGER = Logger.getLogger(TubelineAssemblyContextImpl.class);
|
||||
|
||||
private Tube head;
|
||||
private Pipe adaptedHead;
|
||||
private List<Tube> tubes = new LinkedList<Tube>();
|
||||
|
||||
@Override
|
||||
public Tube getTubelineHead() {
|
||||
return head;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pipe getAdaptedTubelineHead() {
|
||||
if (adaptedHead == null) {
|
||||
adaptedHead = PipeAdapter.adapt(head);
|
||||
}
|
||||
return adaptedHead;
|
||||
}
|
||||
|
||||
boolean setTubelineHead(Tube newHead) {
|
||||
if (newHead == head || newHead == adaptedHead) {
|
||||
return false;
|
||||
}
|
||||
|
||||
head = newHead;
|
||||
tubes.add(head);
|
||||
adaptedHead = null;
|
||||
|
||||
if (LOGGER.isLoggable(Level.FINER)) {
|
||||
LOGGER.finer(MessageFormat.format("Added '{0}' tube instance to the tubeline.", (newHead == null) ? null : newHead.getClass().getName()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getImplementation(Class<T> type) {
|
||||
for (Tube tube : tubes) {
|
||||
if (type.isInstance(tube)) {
|
||||
return type.cast(tube);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
import com.sun.istack.internal.logging.Logger;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.resources.TubelineassemblyMessages;
|
||||
import com.sun.xml.internal.ws.runtime.config.TubeFactoryConfig;
|
||||
import com.sun.xml.internal.ws.runtime.config.TubeFactoryList;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
final class TubelineAssemblyController {
|
||||
|
||||
private final MetroConfigName metroConfigName;
|
||||
|
||||
TubelineAssemblyController(MetroConfigName metroConfigName) {
|
||||
this.metroConfigName = metroConfigName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a ordered collection of WSIT/Metro client-side tube creators that are be used to
|
||||
* construct a client-side Metro tubeline
|
||||
*
|
||||
* The order of the tube creators in the collection is last-to-first from the
|
||||
* client side request message processing perspective.
|
||||
*
|
||||
* <b>
|
||||
* WARNING: This method is part of Metro internal API and may be changed, removed or
|
||||
* replaced by a different method without a prior notice. The method SHOULD NOT be used
|
||||
* outside of Metro codebase.
|
||||
* </b>
|
||||
*
|
||||
* @param endpointUri URI of the endpoint for which the collection of tube factories should be returned
|
||||
*
|
||||
* @return collection of WSIT/Metro client-side tube creators
|
||||
*/
|
||||
Collection<TubeCreator> getTubeCreators(ClientTubelineAssemblyContext context) {
|
||||
URI endpointUri;
|
||||
if (context.getPortInfo() != null) {
|
||||
endpointUri = createEndpointComponentUri(context.getPortInfo().getServiceName(), context.getPortInfo().getPortName());
|
||||
} else {
|
||||
endpointUri = null;
|
||||
}
|
||||
|
||||
MetroConfigLoader configLoader = new MetroConfigLoader(context.getContainer(), metroConfigName);
|
||||
return initializeTubeCreators(configLoader.getClientSideTubeFactories(endpointUri));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a ordered collection of WSIT/Metro server-side tube creators that are be used to
|
||||
* construct a server-side Metro tubeline for a given endpoint
|
||||
*
|
||||
* The order of the tube creators in the collection is last-to-first from the
|
||||
* server side request message processing perspective.
|
||||
*
|
||||
* <b>
|
||||
* WARNING: This method is part of Metro internal API and may be changed, removed or
|
||||
* replaced by a different method without a prior notice. The method SHOULD NOT be used
|
||||
* outside of Metro codebase.
|
||||
* </b>
|
||||
*
|
||||
* @param endpointUri URI of the endpoint for which the collection of tube factories should be returned
|
||||
*
|
||||
* @return collection of WSIT/Metro server-side tube creators
|
||||
*/
|
||||
Collection<TubeCreator> getTubeCreators(DefaultServerTubelineAssemblyContext context) {
|
||||
URI endpointUri;
|
||||
if (context.getEndpoint() != null) {
|
||||
endpointUri = createEndpointComponentUri(context.getEndpoint().getServiceName(), context.getEndpoint().getPortName());
|
||||
} else {
|
||||
endpointUri = null;
|
||||
}
|
||||
|
||||
MetroConfigLoader configLoader = new MetroConfigLoader(context.getEndpoint().getContainer(), metroConfigName);
|
||||
return initializeTubeCreators(configLoader.getEndpointSideTubeFactories(endpointUri));
|
||||
}
|
||||
|
||||
private Collection<TubeCreator> initializeTubeCreators(TubeFactoryList tfl) {
|
||||
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
LinkedList<TubeCreator> tubeCreators = new LinkedList<TubeCreator>();
|
||||
for (TubeFactoryConfig tubeFactoryConfig : tfl.getTubeFactoryConfigs()) {
|
||||
tubeCreators.addFirst(new TubeCreator(tubeFactoryConfig, contextClassLoader));
|
||||
}
|
||||
return tubeCreators;
|
||||
}
|
||||
|
||||
/*
|
||||
* Example WSDL component URI: http://org.sample#wsdl11.port(PingService/HttpPingPort)
|
||||
*/
|
||||
private URI createEndpointComponentUri(@NotNull QName serviceName, @NotNull QName portName) {
|
||||
StringBuilder sb = new StringBuilder(serviceName.getNamespaceURI()).append("#wsdl11.port(").append(serviceName.getLocalPart()).append('/').append(portName.getLocalPart()).append(')');
|
||||
try {
|
||||
return new URI(sb.toString());
|
||||
} catch (URISyntaxException ex) {
|
||||
Logger.getLogger(TubelineAssemblyController.class).warning(
|
||||
TubelineassemblyMessages.MASM_0020_ERROR_CREATING_URI_FROM_GENERATED_STRING(sb.toString()),
|
||||
ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.dev;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
import com.sun.istack.internal.Nullable;
|
||||
import com.sun.xml.internal.ws.api.EndpointAddress;
|
||||
import com.sun.xml.internal.ws.api.WSBinding;
|
||||
import com.sun.xml.internal.ws.api.WSService;
|
||||
import com.sun.xml.internal.ws.api.client.WSPortInfo;
|
||||
import com.sun.xml.internal.ws.api.model.SEIModel;
|
||||
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
|
||||
import com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext;
|
||||
import com.sun.xml.internal.ws.api.pipe.Codec;
|
||||
import com.sun.xml.internal.ws.api.server.Container;
|
||||
import com.sun.xml.internal.ws.policy.PolicyMap;
|
||||
|
||||
/**
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public interface ClientTubelineAssemblyContext extends TubelineAssemblyContext {
|
||||
|
||||
/**
|
||||
* The endpoint address. Always non-null. This parameter is taken separately
|
||||
* from {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort} (even though there's {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort#getAddress()})
|
||||
* because sometimes WSDL is not available.
|
||||
*/
|
||||
@NotNull
|
||||
EndpointAddress getAddress();
|
||||
|
||||
/**
|
||||
* The binding of the new pipeline to be created.
|
||||
*/
|
||||
@NotNull
|
||||
WSBinding getBinding();
|
||||
|
||||
/**
|
||||
* Gets the {@link Codec} that is set by {@link #setCodec} or the default codec
|
||||
* based on the binding.
|
||||
*
|
||||
* @return codec to be used for web service requests
|
||||
*/
|
||||
@NotNull
|
||||
Codec getCodec();
|
||||
|
||||
/**
|
||||
* Returns the Container in which the client is running
|
||||
*
|
||||
* @return Container in which client is running
|
||||
*/
|
||||
Container getContainer();
|
||||
|
||||
PolicyMap getPolicyMap();
|
||||
|
||||
WSPortInfo getPortInfo();
|
||||
|
||||
/**
|
||||
* The created pipeline will use seiModel to get java concepts for the endpoint
|
||||
*
|
||||
* @return Null if the service doesn't have SEI model e.g. Dispatch,
|
||||
* and otherwise non-null.
|
||||
*/
|
||||
@Nullable
|
||||
SEIModel getSEIModel();
|
||||
|
||||
/**
|
||||
* The pipeline is created for this {@link com.sun.xml.internal.ws.api.WSService}.
|
||||
* Always non-null. (To be precise, the newly created pipeline
|
||||
* is owned by a proxy or a dispatch created from this {@link com.sun.xml.internal.ws.api.WSService}.)
|
||||
*/
|
||||
@NotNull
|
||||
WSService getService();
|
||||
|
||||
ClientTubeAssemblerContext getWrappedContext();
|
||||
|
||||
/**
|
||||
* The created pipeline will be used to serve this port.
|
||||
* Null if the service isn't associated with any port definition in WSDL,
|
||||
* and otherwise non-null.
|
||||
* <p/>
|
||||
* Replaces {@link com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext#getWsdlModel()}
|
||||
*/
|
||||
WSDLPort getWsdlPort();
|
||||
|
||||
boolean isPolicyAvailable();
|
||||
|
||||
/**
|
||||
* Interception point to change {@link Codec} during {@link com.sun.xml.internal.ws.api.pipe.Tube}line assembly. The
|
||||
* new codec will be used by jax-ws client runtime for encoding/decoding web service
|
||||
* request/response messages. The new codec should be used by the transport tubes.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* the codec should correctly implement {@link Codec#copy} since it is used while
|
||||
* serving requests concurrently.
|
||||
*
|
||||
* @param codec codec to be used for web service requests
|
||||
*/
|
||||
void setCodec(@NotNull
|
||||
Codec codec);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.dev;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
import com.sun.istack.internal.Nullable;
|
||||
import com.sun.xml.internal.ws.api.model.SEIModel;
|
||||
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
|
||||
import com.sun.xml.internal.ws.api.pipe.Codec;
|
||||
import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext;
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.api.server.WSEndpoint;
|
||||
import com.sun.xml.internal.ws.policy.PolicyMap;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public interface ServerTubelineAssemblyContext extends TubelineAssemblyContext {
|
||||
|
||||
/**
|
||||
* Gets the {@link Codec} that is set by {@link #setCodec} or the default codec
|
||||
* based on the binding. The codec is a full codec that is responsible for
|
||||
* encoding/decoding entire protocol message(for e.g: it is responsible to
|
||||
* encode/decode entire MIME messages in SOAP binding)
|
||||
*
|
||||
* @return codec to be used for web service requests
|
||||
* @see com.sun.xml.internal.ws.api.pipe.Codecs
|
||||
*/
|
||||
@NotNull
|
||||
Codec getCodec();
|
||||
|
||||
/**
|
||||
*
|
||||
* The created pipeline is used to serve this {@link com.sun.xml.internal.ws.api.server.WSEndpoint}.
|
||||
* Specifically, its {@link com.sun.xml.internal.ws.api.WSBinding} should be of interest to many
|
||||
* {@link com.sun.xml.internal.ws.api.pipe.Pipe}s.
|
||||
* @return Always non-null.
|
||||
*/
|
||||
@NotNull
|
||||
WSEndpoint getEndpoint();
|
||||
|
||||
PolicyMap getPolicyMap();
|
||||
|
||||
/**
|
||||
* The created pipeline will use seiModel to get java concepts for the endpoint
|
||||
*
|
||||
* @return Null if the service doesn't have SEI model e.g. Provider endpoints,
|
||||
* and otherwise non-null.
|
||||
*/
|
||||
@Nullable
|
||||
SEIModel getSEIModel();
|
||||
|
||||
/**
|
||||
* The last {@link com.sun.xml.internal.ws.api.pipe.Pipe} in the pipeline. The assembler is expected to put
|
||||
* additional {@link com.sun.xml.internal.ws.api.pipe.Pipe}s in front of it.
|
||||
*
|
||||
* <p>
|
||||
* (Just to give you the idea how this is used, normally the terminal pipe
|
||||
* is the one that invokes the user application or {@link javax.xml.ws.Provider}.)
|
||||
*
|
||||
* @return always non-null terminal pipe
|
||||
*/
|
||||
@NotNull
|
||||
Tube getTerminalTube();
|
||||
|
||||
ServerTubeAssemblerContext getWrappedContext();
|
||||
|
||||
/**
|
||||
* The created pipeline will be used to serve this port.
|
||||
*
|
||||
* @return Null if the service isn't associated with any port definition in WSDL,
|
||||
* and otherwise non-null.
|
||||
*/
|
||||
@Nullable
|
||||
WSDLPort getWsdlPort();
|
||||
|
||||
boolean isPolicyAvailable();
|
||||
|
||||
/**
|
||||
* If this server pipeline is known to be used for serving synchronous transport,
|
||||
* then this method returns true. This can be potentially use as an optimization
|
||||
* hint, since often synchronous versions are cheaper to execute than asycnhronous
|
||||
* versions.
|
||||
*/
|
||||
boolean isSynchronous();
|
||||
|
||||
/**
|
||||
* Interception point to change {@link Codec} during {@link Tube}line assembly. The
|
||||
* new codec will be used by jax-ws server runtime for encoding/decoding web service
|
||||
* request/response messages. {@link WSEndpoint#createCodec()} will return a copy
|
||||
* of this new codec and will be used in the server runtime.
|
||||
*
|
||||
* <p>
|
||||
* The codec is a full codec that is responsible for
|
||||
* encoding/decoding entire protocol message(for e.g: it is responsible to
|
||||
* encode/decode entire MIME messages in SOAP binding)
|
||||
*
|
||||
* <p>
|
||||
* the codec should correctly implement {@link Codec#copy} since it is used while
|
||||
* serving requests concurrently.
|
||||
*
|
||||
* @param codec codec to be used for web service requests
|
||||
* @see com.sun.xml.internal.ws.api.pipe.Codecs
|
||||
*/
|
||||
void setCodec(@NotNull
|
||||
Codec codec);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.dev;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public interface TubeFactory {
|
||||
/**
|
||||
* Adds RM tube to the client-side tubeline, depending on whether RM is enabled or not.
|
||||
*
|
||||
* @param context wsit client tubeline assembler context
|
||||
* @return new tail of the client-side tubeline
|
||||
*/
|
||||
Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException;
|
||||
|
||||
/**
|
||||
* Adds RM tube to the service-side tubeline, depending on whether RM is enabled or not.
|
||||
*
|
||||
* @param context wsit service tubeline assembler context
|
||||
* @return new head of the service-side tubeline
|
||||
*/
|
||||
Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.dev;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Pipe;
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public interface TubelineAssemblyContext {
|
||||
|
||||
Pipe getAdaptedTubelineHead();
|
||||
|
||||
<T> T getImplementation(Class<T> type);
|
||||
|
||||
Tube getTubelineHead();
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.dev;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public interface TubelineAssemblyContextUpdater {
|
||||
/**
|
||||
* TODO javadoc
|
||||
*
|
||||
* @param context
|
||||
* @throws javax.xml.ws.WebServiceException
|
||||
*/
|
||||
void prepareContext(ClientTubelineAssemblyContext context) throws WebServiceException;
|
||||
|
||||
/**
|
||||
* TODO javadoc
|
||||
*
|
||||
* @param context
|
||||
* @throws javax.xml.ws.WebServiceException
|
||||
*/
|
||||
void prepareContext(ServerTubelineAssemblyContext context) throws WebServiceException;
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.dev;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
|
||||
/**
|
||||
* Decorate Tubes during tubeline assembly
|
||||
*
|
||||
* @since 2.2.7
|
||||
*/
|
||||
public class TubelineAssemblyDecorator {
|
||||
/**
|
||||
* Composite decorator
|
||||
* @param decorators decorators
|
||||
* @return composite that delegates to a list of decorators
|
||||
*/
|
||||
public static TubelineAssemblyDecorator composite(Iterable<TubelineAssemblyDecorator> decorators) {
|
||||
return new CompositeTubelineAssemblyDecorator(decorators);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate client tube
|
||||
* @param tube tube
|
||||
* @param context client context
|
||||
* @return updated tube for tubeline or return tube parameter to no-op
|
||||
*/
|
||||
public Tube decorateClient(Tube tube, ClientTubelineAssemblyContext context) {
|
||||
return tube;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate client head tube. The decorateClient method will have been called first.
|
||||
* @param tube tube
|
||||
* @param context client context
|
||||
* @return updated tube for tubeline or return tube parameter to no-op
|
||||
*/
|
||||
public Tube decorateClientHead(
|
||||
Tube tube, ClientTubelineAssemblyContext context) {
|
||||
return tube;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate client tail tube. The decorateClient method will have been called first.
|
||||
* @param tube tube
|
||||
* @param context client context
|
||||
* @return updated tube for tubeline or return tube parameter to no-op
|
||||
*/
|
||||
public Tube decorateClientTail(
|
||||
Tube tube,
|
||||
ClientTubelineAssemblyContext context) {
|
||||
return tube;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate server tube
|
||||
* @param tube tube
|
||||
* @param context server context
|
||||
* @return updated tube for tubeline or return tube parameter to no-op
|
||||
*/
|
||||
public Tube decorateServer(Tube tube, ServerTubelineAssemblyContext context) {
|
||||
return tube;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate server tail tube. The decorateServer method will have been called first.
|
||||
* @param tube tube
|
||||
* @param context server context
|
||||
* @return updated tube for tubeline or return tube parameter to no-op
|
||||
*/
|
||||
public Tube decorateServerTail(
|
||||
Tube tube, ServerTubelineAssemblyContext context) {
|
||||
return tube;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate server head tube. The decorateServer method will have been called first
|
||||
* @param tube tube
|
||||
* @param context server context
|
||||
* @return updated tube for tubeline or return tube parameter to no-op
|
||||
*/
|
||||
public Tube decorateServerHead(
|
||||
Tube tube,
|
||||
ServerTubelineAssemblyContext context) {
|
||||
return tube;
|
||||
}
|
||||
|
||||
private static class CompositeTubelineAssemblyDecorator extends TubelineAssemblyDecorator {
|
||||
private Collection<TubelineAssemblyDecorator> decorators = new ArrayList<TubelineAssemblyDecorator>();
|
||||
|
||||
public CompositeTubelineAssemblyDecorator(Iterable<TubelineAssemblyDecorator> decorators) {
|
||||
for (TubelineAssemblyDecorator decorator : decorators) {
|
||||
this.decorators.add(decorator);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tube decorateClient(Tube tube, ClientTubelineAssemblyContext context) {
|
||||
for (TubelineAssemblyDecorator decorator : decorators) {
|
||||
tube = decorator.decorateClient(tube, context);
|
||||
}
|
||||
return tube;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tube decorateClientHead(
|
||||
Tube tube, ClientTubelineAssemblyContext context) {
|
||||
for (TubelineAssemblyDecorator decorator : decorators) {
|
||||
tube = decorator.decorateClientHead(tube, context);
|
||||
}
|
||||
return tube;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tube decorateClientTail(
|
||||
Tube tube,
|
||||
ClientTubelineAssemblyContext context) {
|
||||
for (TubelineAssemblyDecorator decorator : decorators) {
|
||||
tube = decorator.decorateClientTail(tube, context);
|
||||
}
|
||||
return tube;
|
||||
}
|
||||
|
||||
public Tube decorateServer(Tube tube, ServerTubelineAssemblyContext context) {
|
||||
for (TubelineAssemblyDecorator decorator : decorators) {
|
||||
tube = decorator.decorateServer(tube, context);
|
||||
}
|
||||
return tube;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tube decorateServerTail(
|
||||
Tube tube, ServerTubelineAssemblyContext context) {
|
||||
for (TubelineAssemblyDecorator decorator : decorators) {
|
||||
tube = decorator.decorateServerTail(tube, context);
|
||||
}
|
||||
return tube;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tube decorateServerHead(
|
||||
Tube tube,
|
||||
ServerTubelineAssemblyContext context) {
|
||||
for (TubelineAssemblyDecorator decorator : decorators) {
|
||||
tube = decorator.decorateServerHead(tube, context);
|
||||
}
|
||||
return tube;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.jaxws;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
* TubeFactory implementation creating one of the standard JAX-WS RI tubes
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public final class AddressingTubeFactory implements TubeFactory {
|
||||
|
||||
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createWsaTube(context.getTubelineHead());
|
||||
}
|
||||
|
||||
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createWsaTube(context.getTubelineHead());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.jaxws;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
|
||||
/**
|
||||
* TubeFactory implementation creating one of the standard JAX-WS RI tubes
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public final class BasicTransportTubeFactory implements TubeFactory {
|
||||
|
||||
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createTransportTube();
|
||||
}
|
||||
|
||||
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getTubelineHead();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.jaxws;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
* TubeFactory implementation creating one of the standard JAX-WS RI tubes
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public final class HandlerTubeFactory implements TubeFactory {
|
||||
|
||||
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createHandlerTube(context.getTubelineHead());
|
||||
}
|
||||
|
||||
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createHandlerTube(context.getTubelineHead());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.jaxws;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
* TubeFactory implementation creating one of the standard JAX-WS RI tubes
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public final class MonitoringTubeFactory implements TubeFactory {
|
||||
|
||||
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getTubelineHead();
|
||||
}
|
||||
|
||||
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createMonitoringTube(context.getTubelineHead());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.jaxws;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
* TubeFactory implementation creating one of the standard JAX-WS RI tubes
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public final class MustUnderstandTubeFactory implements TubeFactory {
|
||||
|
||||
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createClientMUTube(context.getTubelineHead());
|
||||
}
|
||||
|
||||
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createServerMUTube(context.getTubelineHead());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.jaxws;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
* TubeFactory implementation creating one of the standard JAX-WS RI tubes
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public final class TerminalTubeFactory implements TubeFactory {
|
||||
|
||||
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getTubelineHead();
|
||||
}
|
||||
|
||||
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().getTerminalTube();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.ws.assembler.jaxws;
|
||||
|
||||
import com.sun.xml.internal.ws.api.pipe.Tube;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ClientTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.ServerTubelineAssemblyContext;
|
||||
import com.sun.xml.internal.ws.assembler.dev.TubeFactory;
|
||||
|
||||
import javax.xml.ws.WebServiceException;
|
||||
|
||||
/**
|
||||
* TubeFactory implementation creating one of the standard JAX-WS RI tubes
|
||||
*
|
||||
* @author Marek Potociar (marek.potociar at sun.com)
|
||||
*/
|
||||
public final class ValidationTubeFactory implements TubeFactory {
|
||||
|
||||
@Override
|
||||
public Tube createTube(ClientTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createValidationTube(context.getTubelineHead());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
|
||||
return context.getWrappedContext().createValidationTube(context.getTubelineHead());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user