You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ri...@apache.org on 2006/08/09 02:47:34 UTC
svn commit: r429905 - in /incubator/tuscany/java/sca:
bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/
core/src/main/java/org/apache/tuscany/core/launcher/
Author: rineholt
Date: Tue Aug 8 17:47:33 2006
New Revision: 429905
URL: http://svn.apache.org/viewvc?rev=429905&view=rev
Log:
Switched the Launcher context thread so it the same as the current loader. This is so axis has stax provider... maybe a better way in the future
For axis reference use the java inteface specified in the reference scdl for the interface for autowire .. this is a bad hack.. I think need a way to opt out of autowire where it may not make sense.
Modified:
incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
Modified: incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java?rev=429905&r1=429904&r2=429905&view=diff
==============================================================================
--- incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java (original)
+++ incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java Tue Aug 8 17:47:33 2006
@@ -19,6 +19,7 @@
import org.apache.tuscany.spi.extension.BindingBuilderExtension;
import org.apache.tuscany.spi.model.BoundReferenceDefinition;
import org.apache.tuscany.spi.model.BoundServiceDefinition;
+import org.apache.tuscany.spi.model.ServiceContract;
/**
* Builds a {@link org.osoa.sca.annotations.Service} or {@link org.apache.tuscany.spi.component.Reference} configured
@@ -47,11 +48,13 @@
BoundReferenceDefinition<WebServiceBinding> boundReferenceDefinition,
DeploymentContext deploymentContext) {
WebServiceBinding wsBinding = boundReferenceDefinition.getBinding();
+
return new Axis2Reference(
boundReferenceDefinition.getName(),
parent,
wireService,
- wsBinding);
+ wsBinding,
+ boundReferenceDefinition.getServiceContract());
}
protected Class<WebServiceBinding> getBindingType() {
Modified: incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java?rev=429905&r1=429904&r2=429905&view=diff
==============================================================================
--- incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java (original)
+++ incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java Tue Aug 8 17:47:33 2006
@@ -23,6 +23,7 @@
import org.apache.tuscany.spi.component.CompositeComponent;
import org.apache.tuscany.spi.extension.ReferenceExtension;
+import org.apache.tuscany.spi.model.ServiceContract;
import org.apache.tuscany.spi.wire.TargetInvoker;
import org.apache.tuscany.spi.wire.WireService;
@@ -50,13 +51,23 @@
private WebServicePortMetaData wsPortMetaData;
private ServiceClient serviceClient;
+
+ public Axis2Reference(String theName,
+ CompositeComponent<?> parent,
+ WireService wireService,
+ WebServiceBinding wsBinding) {
+ this(theName,parent, wireService, wsBinding, null);
+ }
public Axis2Reference(String theName,
CompositeComponent<?> parent,
WireService wireService,
- WebServiceBinding wsBinding) {
+ WebServiceBinding wsBinding, ServiceContract contract) {
super(theName, parent, wireService);
try {
+ if(null != contract){
+ setInterface((Class<T>)contract.getInterfaceClass());
+ }
Definition wsdlDefinition = wsBinding.getWSDLDefinition();
wsPortMetaData =
new WebServicePortMetaData(wsdlDefinition, wsBinding.getWSDLPort(), wsBinding.getURI(), false);
Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java?rev=429905&r1=429904&r2=429905&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java (original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java Tue Aug 8 17:47:33 2006
@@ -37,32 +37,35 @@
/**
* Basic launcher implementation.
- *
+ *
* @version $Rev: 417136 $ $Date: 2006-06-26 03:54:48 -0400 (Mon, 26 Jun 2006) $
*/
public class Launcher {
/**
* A conventional META-INF based location for the system SCDL.
- *
+ *
* @see #bootRuntime(URL, MonitorFactory)
*/
public static final String METAINF_SYSTEM_SCDL_PATH = "META-INF/tuscany/system.scdl";
/**
* A conventional META-INF based location for the application SCDL.
- *
+ *
* @see #bootApplication(URL)
*/
public static final String METAINF_APPLICATION_SCDL_PATH = "META-INF/sca/default.scdl";
private ClassLoader applicationLoader;
+
private RuntimeComponent runtime;
+
private Deployer deployer;
+
private CompositeComponent<?> composite;
/**
* Returns the classloader for application classes.
- *
+ *
* @return the classloader for application classes
*/
public ClassLoader getApplicationLoader() {
@@ -70,10 +73,11 @@
}
/**
- * Set the classloader to be used for application classes. You should almost always supply your own
- * application classloader, based on the hosting environment that the runtime is embedded in.
- *
- * @param applicationLoader the classloader to be used for application classes
+ * Set the classloader to be used for application classes. You should almost always supply your own application classloader, based on the hosting
+ * environment that the runtime is embedded in.
+ *
+ * @param applicationLoader
+ * the classloader to be used for application classes
*/
public void setApplicationLoader(ClassLoader applicationLoader) {
this.applicationLoader = applicationLoader;
@@ -81,8 +85,9 @@
/**
* Boots the runtime defined by the specified SCDL.
- *
- * @param systemScdl a resource path to the SCDL defining the system.
+ *
+ * @param systemScdl
+ * a resource path to the SCDL defining the system.
* @return a CompositeComponent for the newly booted runtime system
* @throws LoaderException
*/
@@ -109,9 +114,8 @@
SystemCompositeImplementation moduleImplementation = new SystemCompositeImplementation();
moduleImplementation.setScdlLocation(systemScdl);
moduleImplementation.setClassLoader(systemClassLoader);
- ComponentDefinition<SystemCompositeImplementation> moduleDefinition =
- new ComponentDefinition<SystemCompositeImplementation>(ComponentNames.TUSCANY_SYSTEM,
- moduleImplementation);
+ ComponentDefinition<SystemCompositeImplementation> moduleDefinition = new ComponentDefinition<SystemCompositeImplementation>(
+ ComponentNames.TUSCANY_SYSTEM, moduleImplementation);
// deploy the component into the runtime under the system parent
composite = (CompositeComponent<?>) bootDeployer.deploy(parent, moduleDefinition);
@@ -140,9 +144,10 @@
/**
* Boots the application defined by the specified SCDL.
- *
- * @see METAINF_APPLICATION_SCDL_PATH
- * @param appScdl URL to the SCDL defining the application
+ *
+ * @see METAINF_APPLICATION_SCDL_PATH
+ * @param appScdl
+ * URL to the SCDL defining the application
* @return a CompositeComponent for the newly booted application
* @throws LoaderException
*/
@@ -156,12 +161,21 @@
CompositeImplementation impl = new CompositeImplementation();
impl.setScdlLocation(appScdl);
impl.setClassLoader(applicationLoader);
- ComponentDefinition<CompositeImplementation> moduleDefinition =
- new ComponentDefinition<CompositeImplementation>(ComponentNames.TUSCANY_SYSTEM, impl);
+ ComponentDefinition<CompositeImplementation> moduleDefinition = new ComponentDefinition<CompositeImplementation>(
+ ComponentNames.TUSCANY_SYSTEM, impl);
// deploy the component into the runtime under the system parent
CompositeComponent parent = runtime.getRootComponent();
- return (CompositeComponent<?>) deployer.deploy(parent, moduleDefinition);
+ ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+
+ try {
+
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
+ return (CompositeComponent<?>) deployer.deploy(parent, moduleDefinition);
+ } finally {
+ Thread.currentThread().setContextClassLoader(ccl);
+ }
}
public File getInstallDirectory() {
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org
Re: Axiom and classloaders, was: svn commit: r429905
Posted by Rick <cr...@gmail.com>.
FWIW: Here is a stack trace.
Exception in thread "main" javax.xml.stream.FactoryConfigurationError:
Provider com.bea.xml.stream.MXParserFactory not found
at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
at
javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
at
org.apache.axiom.om.util.StAXUtils.getXMLInputFactory(StAXUtils.java:35)
at
org.apache.axiom.om.util.StAXUtils.createXMLStreamReader(StAXUtils.java:59)
at
org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:81)
at
org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:63)
at
org.apache.tuscany.binding.axis2.util.TuscanyAxisConfigurator.getConfigurationContext(TuscanyAxisConfigurator.java:72)
at
org.apache.tuscany.binding.axis2.Axis2Reference.createServiceClient(Axis2Reference.java:102)
at
org.apache.tuscany.binding.axis2.Axis2Reference.<init>(Axis2Reference.java:74)
at
org.apache.tuscany.binding.axis2.Axis2BindingBuilder.build(Axis2BindingBuilder.java:52)
at
org.apache.tuscany.core.builder.BuilderRegistryImpl.build(BuilderRegistryImpl.java:141)
at
org.apache.tuscany.core.implementation.composite.CompositeBuilder.build(CompositeBuilder.java:94)
at
org.apache.tuscany.core.builder.BuilderRegistryImpl.build(BuilderRegistryImpl.java:99)
at
org.apache.tuscany.core.deployer.DeployerImpl.build(DeployerImpl.java:125)
at
org.apache.tuscany.core.deployer.DeployerImpl.deploy(DeployerImpl.java:91)
at
org.apache.tuscany.core.launcher.Launcher.bootApplication(Launcher.java:175)
at
org.apache.tuscany.core.launcher.MainLauncher.boot(MainLauncher.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tuscany.launcher.MainLauncherBooter.main(MainLauncherBooter.java:67)
Jeremy Boynes wrote:
> On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
>
>> If we can find another way without applying our private changes to
>> Axis I'm perfectly fine by that. Have any detailed suggestion off hand?
>
> Looks like the problem may lie in o.a.axiom.om.util.StAXUtils - can
> you confirm that where you were getting the problem? If so, I would
> suggest we take this to the Axiom list.
>
> --
> Jeremy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Axiom and classloaders, was: svn commit: r429905
Posted by Davanum Srinivas <da...@gmail.com>.
My best guess is end of this month...
-- dims
On 8/9/06, Rick <cr...@gmail.com> wrote:
> Per jumping to SNAPSHOTS of Axis 2.0 builds: Dims, any thoughts where
> you think Axis 2.0 is in the life cycle of the next release? Are things
> fairly stable ? I seen some talk on the mailing list about release 1.1
> but I didn't get a good feel for any specific target date.
>
>
> Jeremy Boynes wrote:
> > Thanks Dims.
> >
> > I saw the fixes (r427662) for classloader issues with Spring as well -
> > Rick, I think perhaps we should be using a SNAPSHOT of axis for this
> > as well.
> >
> > --
> > Jeremy
> >
> > On Aug 9, 2006, at 7:07 AM, Davanum Srinivas wrote:
> >
> >> Checked in the fix from Jeremy. Please pick up the nighty later today.
> >>
> >> thanks,
> >> dims
> >>
> >> On 8/9/06, Rick <cr...@gmail.com> wrote:
> >>> We are building with Axis 2.0 version 1.0 release.
> >>>
> >>> Davanum Srinivas wrote:
> >>> > Are u folks using latest Axis2 SVN?
> >>> >
> >>> > -- dims
> >>> >
> >>> > On 8/9/06, Jeremy Boynes <jb...@apache.org> wrote:
> >>> >> On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
> >>> >>
> >>> >> > If we can find another way without applying our private changes to
> >>> >> > Axis I'm perfectly fine by that. Have any detailed suggestion off
> >>> >> > hand?
> >>> >>
> >>> >> Looks like the problem may lie in o.a.axiom.om.util.StAXUtils - can
> >>> >> you confirm that where you were getting the problem? If so, I would
> >>> >> suggest we take this to the Axiom list.
> >>> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Axiom and classloaders, was: svn commit: r429905
Posted by Rick <cr...@gmail.com>.
Per jumping to SNAPSHOTS of Axis 2.0 builds: Dims, any thoughts where
you think Axis 2.0 is in the life cycle of the next release? Are things
fairly stable ? I seen some talk on the mailing list about release 1.1
but I didn't get a good feel for any specific target date.
Jeremy Boynes wrote:
> Thanks Dims.
>
> I saw the fixes (r427662) for classloader issues with Spring as well -
> Rick, I think perhaps we should be using a SNAPSHOT of axis for this
> as well.
>
> --
> Jeremy
>
> On Aug 9, 2006, at 7:07 AM, Davanum Srinivas wrote:
>
>> Checked in the fix from Jeremy. Please pick up the nighty later today.
>>
>> thanks,
>> dims
>>
>> On 8/9/06, Rick <cr...@gmail.com> wrote:
>>> We are building with Axis 2.0 version 1.0 release.
>>>
>>> Davanum Srinivas wrote:
>>> > Are u folks using latest Axis2 SVN?
>>> >
>>> > -- dims
>>> >
>>> > On 8/9/06, Jeremy Boynes <jb...@apache.org> wrote:
>>> >> On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
>>> >>
>>> >> > If we can find another way without applying our private changes to
>>> >> > Axis I'm perfectly fine by that. Have any detailed suggestion off
>>> >> > hand?
>>> >>
>>> >> Looks like the problem may lie in o.a.axiom.om.util.StAXUtils - can
>>> >> you confirm that where you were getting the problem? If so, I would
>>> >> suggest we take this to the Axiom list.
>>> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Axiom and classloaders, was: svn commit: r429905
Posted by Jeremy Boynes <jb...@apache.org>.
Thanks Dims.
I saw the fixes (r427662) for classloader issues with Spring as well
- Rick, I think perhaps we should be using a SNAPSHOT of axis for
this as well.
--
Jeremy
On Aug 9, 2006, at 7:07 AM, Davanum Srinivas wrote:
> Checked in the fix from Jeremy. Please pick up the nighty later today.
>
> thanks,
> dims
>
> On 8/9/06, Rick <cr...@gmail.com> wrote:
>> We are building with Axis 2.0 version 1.0 release.
>>
>> Davanum Srinivas wrote:
>> > Are u folks using latest Axis2 SVN?
>> >
>> > -- dims
>> >
>> > On 8/9/06, Jeremy Boynes <jb...@apache.org> wrote:
>> >> On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
>> >>
>> >> > If we can find another way without applying our private
>> changes to
>> >> > Axis I'm perfectly fine by that. Have any detailed
>> suggestion off
>> >> > hand?
>> >>
>> >> Looks like the problem may lie in o.a.axiom.om.util.StAXUtils -
>> can
>> >> you confirm that where you were getting the problem? If so, I
>> would
>> >> suggest we take this to the Axiom list.
>> >>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Axiom and classloaders, was: svn commit: r429905
Posted by Davanum Srinivas <da...@gmail.com>.
Checked in the fix from Jeremy. Please pick up the nighty later today.
thanks,
dims
On 8/9/06, Rick <cr...@gmail.com> wrote:
> We are building with Axis 2.0 version 1.0 release.
>
> Davanum Srinivas wrote:
> > Are u folks using latest Axis2 SVN?
> >
> > -- dims
> >
> > On 8/9/06, Jeremy Boynes <jb...@apache.org> wrote:
> >> On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
> >>
> >> > If we can find another way without applying our private changes to
> >> > Axis I'm perfectly fine by that. Have any detailed suggestion off
> >> > hand?
> >>
> >> Looks like the problem may lie in o.a.axiom.om.util.StAXUtils - can
> >> you confirm that where you were getting the problem? If so, I would
> >> suggest we take this to the Axiom list.
> >>
> >> --
> >> Jeremy
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Axiom and classloaders, was: svn commit: r429905
Posted by Rick <cr...@gmail.com>.
We are building with Axis 2.0 version 1.0 release.
Davanum Srinivas wrote:
> Are u folks using latest Axis2 SVN?
>
> -- dims
>
> On 8/9/06, Jeremy Boynes <jb...@apache.org> wrote:
>> On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
>>
>> > If we can find another way without applying our private changes to
>> > Axis I'm perfectly fine by that. Have any detailed suggestion off
>> > hand?
>>
>> Looks like the problem may lie in o.a.axiom.om.util.StAXUtils - can
>> you confirm that where you were getting the problem? If so, I would
>> suggest we take this to the Axiom list.
>>
>> --
>> Jeremy
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: Axiom and classloaders, was: svn commit: r429905
Posted by Davanum Srinivas <da...@gmail.com>.
Are u folks using latest Axis2 SVN?
-- dims
On 8/9/06, Jeremy Boynes <jb...@apache.org> wrote:
> On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
>
> > If we can find another way without applying our private changes to
> > Axis I'm perfectly fine by that. Have any detailed suggestion off
> > hand?
>
> Looks like the problem may lie in o.a.axiom.om.util.StAXUtils - can
> you confirm that where you were getting the problem? If so, I would
> suggest we take this to the Axiom list.
>
> --
> Jeremy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Axiom and classloaders, was: svn commit: r429905
Posted by Jeremy Boynes <jb...@apache.org>.
On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
> If we can find another way without applying our private changes to
> Axis I'm perfectly fine by that. Have any detailed suggestion off
> hand?
Looks like the problem may lie in o.a.axiom.om.util.StAXUtils - can
you confirm that where you were getting the problem? If so, I would
suggest we take this to the Axiom list.
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Use of TCCL, was: svn commit: r429905
Posted by Jeremy Boynes <jb...@apache.org>.
On Aug 8, 2006, at 8:38 PM, cr22rc wrote:
> If we can find another way without applying our private changes to
> Axis I'm perfectly fine by that. Have any detailed suggestion off
> hand? Do I have access to that particular classloader at the Axis
> binding point? Not sure. Need to check tomorrow. .If not, where
> should it be stashed away ? DeploymentContext?
You have access to two classloaders - the one used to load you (the
binding extension) and the one that will be used for the application
(supplied in the DeploymentContext). The one in the TCCL is of
unspecified origin i.e. it may have been set by something else before
calling the Tuscany code - in this case it is set by the Sun runtime
but in the webapp environment it will have been set by Tomcat/
WebLogic/WebSphere/...
Specifically, your code may *not* have permission to load or set the
TCCL.
> Just curious, as I recall TCCL was set to the sun boot loader if
> I'm not mistaken. If so, why is that better?
As above it was not set by us, it was inherited from the host.
> Seems a tad odd that that is the "context". Wouldn't it make sense
> for it to be set to the same loader that is loading / configuring
> the binding?
We really trying to get to a mode where we do not rely on the TCCL at
all - deployment code should be able to work with classloaders that
are specifically supplied to it. In fact, the only time we should set
the TCCL is when calling into user-supplied code.
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: svn commit: r429905 - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/
core/src/main/java/org/apache/tuscany/core/launcher/
Posted by cr22rc <cr...@gmail.com>.
If we can find another way without applying our private changes to Axis
I'm perfectly fine by that. Have any detailed suggestion off hand?
Do I have access to that particular classloader at the Axis binding
point? Not sure. Need to check tomorrow. .If not, where should it be
stashed away ? DeploymentContext?
Just curious, as I recall TCCL was set to the sun boot loader if I'm not
mistaken. If so, why is that better? Seems a tad odd that that is the
"context". Wouldn't it make sense for it to be set to the same loader
that is loading / configuring the binding?
Jeremy Boynes wrote:
> If Axis has a dependency that the TCCL always contains a stax
> implementation we are going to run into a bunch of problems in the
> future - if you remember, a lot of the annoying problems with M1 were
> caused by trying to get a suitable classloader on the thread for Axis
> and/or SDO. We really need a way to tell Axis which stax
> implementation to use (e.g. passing it an XMLInputFactory), or at
> least which classloader to use.
>
> If the only way we can do this at the moment is by using the TCCL then
> it should be set in the Axis extension and not in the general deployer
> so that this problem can be isolated.
>
> --
> Jeremy
>
> On Aug 8, 2006, at 8:08 PM, cr22rc wrote:
>
>> Switched the Launcher context thread so it the same as the current
>> loader. This is so axis has stax provider... maybe a better way in
>> the future
>> Without this Axis code doesn't seem to find an implementation for Stax.
>> Jeremy Boynes wrote:
>>> The deployer should never need the TCCL to be adjusted. What is the
>>> issue with Axis during the deployment phase that requires this to be
>>> set?
>>>
>>> --Jeremy
>>>
>>> On Aug 8, 2006, at 5:47 PM, rineholt@apache.org wrote:
>>>
>>>> Author: rineholt
>>>> Date: Tue Aug 8 17:47:33 2006
>>>> New Revision: 429905
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=429905&view=rev
>>>> Log:
>>>> Switched the Launcher context thread so it the same as the current
>>>> loader. This is so axis has stax provider... maybe a better way in
>>>> the future
>>>> For axis reference use the java inteface specified in the reference
>>>> scdl for the interface for autowire .. this is a bad hack.. I think
>>>> need a way to opt out of autowire where it may not make sense.
>>>>
>>>>
>>>> Modified:
>>>>
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>>>
>>>>
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>>>
>>>>
>>>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>>>>
>>>>
>>>> Modified:
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java?rev=429905&r1=429904&r2=429905&view=diff
>>>>
>>>> ==============================================================================
>>>>
>>>> ---
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>>> (original)
>>>> +++
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>>> Tue Aug 8 17:47:33 2006
>>>> @@ -19,6 +19,7 @@
>>>> import org.apache.tuscany.spi.extension.BindingBuilderExtension;
>>>> import org.apache.tuscany.spi.model.BoundReferenceDefinition;
>>>> import org.apache.tuscany.spi.model.BoundServiceDefinition;
>>>> +import org.apache.tuscany.spi.model.ServiceContract;
>>>>
>>>> /**
>>>> * Builds a {@link org.osoa.sca.annotations.Service} or {@link
>>>> org.apache.tuscany.spi.component.Reference} configured
>>>> @@ -47,11 +48,13 @@
>>>>
>>>> BoundReferenceDefinition<WebServiceBinding> boundReferenceDefinition,
>>>> DeploymentContext deploymentContext) {
>>>> WebServiceBinding wsBinding =
>>>> boundReferenceDefinition.getBinding();
>>>> +
>>>> return new Axis2Reference(
>>>> boundReferenceDefinition.getName(),
>>>> parent,
>>>> wireService,
>>>> - wsBinding);
>>>> + wsBinding,
>>>> + boundReferenceDefinition.getServiceContract());
>>>> }
>>>>
>>>> protected Class<WebServiceBinding> getBindingType() {
>>>>
>>>> Modified:
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java?rev=429905&r1=429904&r2=429905&view=diff
>>>>
>>>> ==============================================================================
>>>>
>>>> ---
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>>> (original)
>>>> +++
>>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>>> Tue Aug 8 17:47:33 2006
>>>> @@ -23,6 +23,7 @@
>>>>
>>>> import org.apache.tuscany.spi.component.CompositeComponent;
>>>> import org.apache.tuscany.spi.extension.ReferenceExtension;
>>>> +import org.apache.tuscany.spi.model.ServiceContract;
>>>> import org.apache.tuscany.spi.wire.TargetInvoker;
>>>> import org.apache.tuscany.spi.wire.WireService;
>>>>
>>>> @@ -50,13 +51,23 @@
>>>>
>>>> private WebServicePortMetaData wsPortMetaData;
>>>> private ServiceClient serviceClient;
>>>> +
>>>> + public Axis2Reference(String theName,
>>>> + CompositeComponent<?> parent,
>>>> + WireService wireService,
>>>> + WebServiceBinding wsBinding) {
>>>> + this(theName,parent, wireService, wsBinding, null);
>>>> + }
>>>>
>>>> public Axis2Reference(String theName,
>>>> CompositeComponent<?> parent,
>>>> WireService wireService,
>>>> - WebServiceBinding wsBinding) {
>>>> + WebServiceBinding wsBinding,
>>>> ServiceContract contract) {
>>>> super(theName, parent, wireService);
>>>> try {
>>>> + if(null != contract){
>>>> + setInterface((Class<T>)contract.getInterfaceClass());
>>>> + }
>>>> Definition wsdlDefinition =
>>>> wsBinding.getWSDLDefinition();
>>>> wsPortMetaData =
>>>> new WebServicePortMetaData(wsdlDefinition,
>>>> wsBinding.getWSDLPort(), wsBinding.getURI(), false);
>>>>
>>>> Modified:
>>>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java?rev=429905&r1=429904&r2=429905&view=diff
>>>>
>>>> ==============================================================================
>>>>
>>>> ---
>>>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>>>> (original)
>>>> +++
>>>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>>>> Tue Aug 8 17:47:33 2006
>>>> @@ -37,32 +37,35 @@
>>>>
>>>> /**
>>>> * Basic launcher implementation.
>>>> - *
>>>> + *
>>>> * @version $Rev: 417136 $ $Date: 2006-06-26 03:54:48 -0400 (Mon,
>>>> 26 Jun 2006) $
>>>> */
>>>> public class Launcher {
>>>> /**
>>>> * A conventional META-INF based location for the system SCDL.
>>>> - *
>>>> + *
>>>> * @see #bootRuntime(URL, MonitorFactory)
>>>> */
>>>> public static final String METAINF_SYSTEM_SCDL_PATH =
>>>> "META-INF/tuscany/system.scdl";
>>>>
>>>> /**
>>>> * A conventional META-INF based location for the application
>>>> SCDL.
>>>> - *
>>>> + *
>>>> * @see #bootApplication(URL)
>>>> */
>>>> public static final String METAINF_APPLICATION_SCDL_PATH =
>>>> "META-INF/sca/default.scdl";
>>>>
>>>> private ClassLoader applicationLoader;
>>>> +
>>>> private RuntimeComponent runtime;
>>>> +
>>>> private Deployer deployer;
>>>> +
>>>> private CompositeComponent<?> composite;
>>>>
>>>> /**
>>>> * Returns the classloader for application classes.
>>>> - *
>>>> + *
>>>> * @return the classloader for application classes
>>>> */
>>>> public ClassLoader getApplicationLoader() {
>>>> @@ -70,10 +73,11 @@
>>>> }
>>>>
>>>> /**
>>>> - * Set the classloader to be used for application classes.
>>>> You should almost always supply your own
>>>> - * application classloader, based on the hosting environment
>>>> that the runtime is embedded in.
>>>> - *
>>>> - * @param applicationLoader the classloader to be used for
>>>> application classes
>>>> + * Set the classloader to be used for application classes. You
>>>> should almost always supply your own application classloader, based
>>>> on the hosting
>>>> + * environment that the runtime is embedded in.
>>>> + *
>>>> + * @param applicationLoader
>>>> + * the classloader to be used for application classes
>>>> */
>>>> public void setApplicationLoader(ClassLoader applicationLoader) {
>>>> this.applicationLoader = applicationLoader;
>>>> @@ -81,8 +85,9 @@
>>>>
>>>> /**
>>>> * Boots the runtime defined by the specified SCDL.
>>>> - *
>>>> - * @param systemScdl a resource path to the SCDL defining the
>>>> system.
>>>> + *
>>>> + * @param systemScdl
>>>> + * a resource path to the SCDL defining the system.
>>>> * @return a CompositeComponent for the newly booted runtime
>>>> system
>>>> * @throws LoaderException
>>>> */
>>>> @@ -109,9 +114,8 @@
>>>> SystemCompositeImplementation moduleImplementation = new
>>>> SystemCompositeImplementation();
>>>> moduleImplementation.setScdlLocation(systemScdl);
>>>> moduleImplementation.setClassLoader(systemClassLoader);
>>>> - ComponentDefinition<SystemCompositeImplementation>
>>>> moduleDefinition =
>>>> - new
>>>> ComponentDefinition<SystemCompositeImplementation>(ComponentNames.TUSCANY_SYSTEM,
>>>>
>>>> -
>>>> moduleImplementation);
>>>> + ComponentDefinition<SystemCompositeImplementation>
>>>> moduleDefinition = new
>>>> ComponentDefinition<SystemCompositeImplementation>(
>>>> + ComponentNames.TUSCANY_SYSTEM, moduleImplementation);
>>>>
>>>> // deploy the component into the runtime under the system
>>>> parent
>>>> composite = (CompositeComponent<?>)
>>>> bootDeployer.deploy(parent, moduleDefinition);
>>>> @@ -140,9 +144,10 @@
>>>>
>>>> /**
>>>> * Boots the application defined by the specified SCDL.
>>>> - *
>>>> - * @see METAINF_APPLICATION_SCDL_PATH
>>>> - * @param appScdl URL to the SCDL defining the application
>>>> + *
>>>> + * @see METAINF_APPLICATION_SCDL_PATH
>>>> + * @param appScdl
>>>> + * URL to the SCDL defining the application
>>>> * @return a CompositeComponent for the newly booted application
>>>> * @throws LoaderException
>>>> */
>>>> @@ -156,12 +161,21 @@
>>>> CompositeImplementation impl = new CompositeImplementation();
>>>> impl.setScdlLocation(appScdl);
>>>> impl.setClassLoader(applicationLoader);
>>>> - ComponentDefinition<CompositeImplementation>
>>>> moduleDefinition =
>>>> - new
>>>> ComponentDefinition<CompositeImplementation>(ComponentNames.TUSCANY_SYSTEM,
>>>> impl);
>>>> + ComponentDefinition<CompositeImplementation>
>>>> moduleDefinition = new ComponentDefinition<CompositeImplementation>(
>>>> + ComponentNames.TUSCANY_SYSTEM, impl);
>>>>
>>>> // deploy the component into the runtime under the system
>>>> parent
>>>> CompositeComponent parent = runtime.getRootComponent();
>>>> - return (CompositeComponent<?>) deployer.deploy(parent,
>>>> moduleDefinition);
>>>> + ClassLoader ccl =
>>>> Thread.currentThread().getContextClassLoader();
>>>> +
>>>> + try {
>>>> +
>>>> +
>>>> Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
>>>>
>>>> +
>>>> + return (CompositeComponent<?>) deployer.deploy(parent,
>>>> moduleDefinition);
>>>> + } finally {
>>>> + Thread.currentThread().setContextClassLoader(ccl);
>>>> + }
>>>> }
>>>>
>>>> public File getInstallDirectory() {
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
>>>> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: svn commit: r429905 - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/ core/src/main/java/org/apache/tuscany/core/launcher/
Posted by Jeremy Boynes <jb...@apache.org>.
If Axis has a dependency that the TCCL always contains a stax
implementation we are going to run into a bunch of problems in the
future - if you remember, a lot of the annoying problems with M1 were
caused by trying to get a suitable classloader on the thread for Axis
and/or SDO. We really need a way to tell Axis which stax
implementation to use (e.g. passing it an XMLInputFactory), or at
least which classloader to use.
If the only way we can do this at the moment is by using the TCCL
then it should be set in the Axis extension and not in the general
deployer so that this problem can be isolated.
--
Jeremy
On Aug 8, 2006, at 8:08 PM, cr22rc wrote:
> Switched the Launcher context thread so it the same as the current
> loader. This is so axis has stax provider... maybe a better way in
> the future
> Without this Axis code doesn't seem to find an implementation for
> Stax.
> Jeremy Boynes wrote:
>> The deployer should never need the TCCL to be adjusted. What is
>> the issue with Axis during the deployment phase that requires this
>> to be set?
>>
>> --
>> Jeremy
>>
>> On Aug 8, 2006, at 5:47 PM, rineholt@apache.org wrote:
>>
>>> Author: rineholt
>>> Date: Tue Aug 8 17:47:33 2006
>>> New Revision: 429905
>>>
>>> URL: http://svn.apache.org/viewvc?rev=429905&view=rev
>>> Log:
>>> Switched the Launcher context thread so it the same as the
>>> current loader. This is so axis has stax provider... maybe a
>>> better way in the future
>>> For axis reference use the java inteface specified in the
>>> reference scdl for the interface for autowire .. this is a bad
>>> hack.. I think need a way to opt out of autowire where it may not
>>> make sense.
>>>
>>>
>>> Modified:
>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/
>>> java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/
>>> java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>> incubator/tuscany/java/sca/core/src/main/java/org/apache/
>>> tuscany/core/launcher/Launcher.java
>>>
>>> Modified: incubator/tuscany/java/sca/bindings/binding.axis2/src/
>>> main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/
>>> bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/
>>> axis2/Axis2BindingBuilder.java?
>>> rev=429905&r1=429904&r2=429905&view=diff
>>> ====================================================================
>>> ==========
>>> --- incubator/tuscany/java/sca/bindings/binding.axis2/src/main/
>>> java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>> (original)
>>> +++ incubator/tuscany/java/sca/bindings/binding.axis2/src/main/
>>> java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>> Tue Aug 8 17:47:33 2006
>>> @@ -19,6 +19,7 @@
>>> import org.apache.tuscany.spi.extension.BindingBuilderExtension;
>>> import org.apache.tuscany.spi.model.BoundReferenceDefinition;
>>> import org.apache.tuscany.spi.model.BoundServiceDefinition;
>>> +import org.apache.tuscany.spi.model.ServiceContract;
>>>
>>> /**
>>> * Builds a {@link org.osoa.sca.annotations.Service} or {@link
>>> org.apache.tuscany.spi.component.Reference} configured
>>> @@ -47,11 +48,13 @@
>>>
>>> BoundReferenceDefinition<WebServiceBinding>
>>> boundReferenceDefinition,
>>> DeploymentContext deploymentContext) {
>>> WebServiceBinding wsBinding =
>>> boundReferenceDefinition.getBinding();
>>> +
>>> return new Axis2Reference(
>>> boundReferenceDefinition.getName(),
>>> parent,
>>> wireService,
>>> - wsBinding);
>>> + wsBinding,
>>> + boundReferenceDefinition.getServiceContract());
>>> }
>>>
>>> protected Class<WebServiceBinding> getBindingType() {
>>>
>>> Modified: incubator/tuscany/java/sca/bindings/binding.axis2/src/
>>> main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/
>>> bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/
>>> axis2/Axis2Reference.java?rev=429905&r1=429904&r2=429905&view=diff
>>> ====================================================================
>>> ==========
>>> --- incubator/tuscany/java/sca/bindings/binding.axis2/src/main/
>>> java/org/apache/tuscany/binding/axis2/Axis2Reference.java (original)
>>> +++ incubator/tuscany/java/sca/bindings/binding.axis2/src/main/
>>> java/org/apache/tuscany/binding/axis2/Axis2Reference.java Tue
>>> Aug 8 17:47:33 2006
>>> @@ -23,6 +23,7 @@
>>>
>>> import org.apache.tuscany.spi.component.CompositeComponent;
>>> import org.apache.tuscany.spi.extension.ReferenceExtension;
>>> +import org.apache.tuscany.spi.model.ServiceContract;
>>> import org.apache.tuscany.spi.wire.TargetInvoker;
>>> import org.apache.tuscany.spi.wire.WireService;
>>>
>>> @@ -50,13 +51,23 @@
>>>
>>> private WebServicePortMetaData wsPortMetaData;
>>> private ServiceClient serviceClient;
>>> +
>>> + public Axis2Reference(String theName,
>>> + CompositeComponent<?> parent,
>>> + WireService wireService,
>>> + WebServiceBinding wsBinding) {
>>> + this(theName,parent, wireService, wsBinding, null);
>>> + }
>>>
>>> public Axis2Reference(String theName,
>>> CompositeComponent<?> parent,
>>> WireService wireService,
>>> - WebServiceBinding wsBinding) {
>>> + WebServiceBinding wsBinding,
>>> ServiceContract contract) {
>>> super(theName, parent, wireService);
>>> try {
>>> + if(null != contract){
>>> + setInterface((Class<T>)contract.getInterfaceClass
>>> ());
>>> + }
>>> Definition wsdlDefinition =
>>> wsBinding.getWSDLDefinition();
>>> wsPortMetaData =
>>> new WebServicePortMetaData(wsdlDefinition,
>>> wsBinding.getWSDLPort(), wsBinding.getURI(), false);
>>>
>>> Modified: incubator/tuscany/java/sca/core/src/main/java/org/
>>> apache/tuscany/core/launcher/Launcher.java
>>> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/
>>> src/main/java/org/apache/tuscany/core/launcher/Launcher.java?
>>> rev=429905&r1=429904&r2=429905&view=diff
>>> ====================================================================
>>> ==========
>>> --- incubator/tuscany/java/sca/core/src/main/java/org/apache/
>>> tuscany/core/launcher/Launcher.java (original)
>>> +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/
>>> tuscany/core/launcher/Launcher.java Tue Aug 8 17:47:33 2006
>>> @@ -37,32 +37,35 @@
>>>
>>> /**
>>> * Basic launcher implementation.
>>> - *
>>> + *
>>> * @version $Rev: 417136 $ $Date: 2006-06-26 03:54:48 -0400
>>> (Mon, 26 Jun 2006) $
>>> */
>>> public class Launcher {
>>> /**
>>> * A conventional META-INF based location for the system SCDL.
>>> - *
>>> + *
>>> * @see #bootRuntime(URL, MonitorFactory)
>>> */
>>> public static final String METAINF_SYSTEM_SCDL_PATH = "META-
>>> INF/tuscany/system.scdl";
>>>
>>> /**
>>> * A conventional META-INF based location for the
>>> application SCDL.
>>> - *
>>> + *
>>> * @see #bootApplication(URL)
>>> */
>>> public static final String METAINF_APPLICATION_SCDL_PATH =
>>> "META-INF/sca/default.scdl";
>>>
>>> private ClassLoader applicationLoader;
>>> +
>>> private RuntimeComponent runtime;
>>> +
>>> private Deployer deployer;
>>> +
>>> private CompositeComponent<?> composite;
>>>
>>> /**
>>> * Returns the classloader for application classes.
>>> - *
>>> + *
>>> * @return the classloader for application classes
>>> */
>>> public ClassLoader getApplicationLoader() {
>>> @@ -70,10 +73,11 @@
>>> }
>>>
>>> /**
>>> - * Set the classloader to be used for application classes.
>>> You should almost always supply your own
>>> - * application classloader, based on the hosting environment
>>> that the runtime is embedded in.
>>> - *
>>> - * @param applicationLoader the classloader to be used for
>>> application classes
>>> + * Set the classloader to be used for application classes.
>>> You should almost always supply your own application classloader,
>>> based on the hosting
>>> + * environment that the runtime is embedded in.
>>> + *
>>> + * @param applicationLoader
>>> + * the classloader to be used for application
>>> classes
>>> */
>>> public void setApplicationLoader(ClassLoader
>>> applicationLoader) {
>>> this.applicationLoader = applicationLoader;
>>> @@ -81,8 +85,9 @@
>>>
>>> /**
>>> * Boots the runtime defined by the specified SCDL.
>>> - *
>>> - * @param systemScdl a resource path to the SCDL defining
>>> the system.
>>> + *
>>> + * @param systemScdl
>>> + * a resource path to the SCDL defining the system.
>>> * @return a CompositeComponent for the newly booted runtime
>>> system
>>> * @throws LoaderException
>>> */
>>> @@ -109,9 +114,8 @@
>>> SystemCompositeImplementation moduleImplementation = new
>>> SystemCompositeImplementation();
>>> moduleImplementation.setScdlLocation(systemScdl);
>>> moduleImplementation.setClassLoader(systemClassLoader);
>>> - ComponentDefinition<SystemCompositeImplementation>
>>> moduleDefinition =
>>> - new
>>> ComponentDefinition<SystemCompositeImplementation>
>>> (ComponentNames.TUSCANY_SYSTEM,
>>> -
>>> moduleImplementation);
>>> + ComponentDefinition<SystemCompositeImplementation>
>>> moduleDefinition = new
>>> ComponentDefinition<SystemCompositeImplementation>(
>>> + ComponentNames.TUSCANY_SYSTEM,
>>> moduleImplementation);
>>>
>>> // deploy the component into the runtime under the
>>> system parent
>>> composite = (CompositeComponent<?>) bootDeployer.deploy
>>> (parent, moduleDefinition);
>>> @@ -140,9 +144,10 @@
>>>
>>> /**
>>> * Boots the application defined by the specified SCDL.
>>> - *
>>> - * @see METAINF_APPLICATION_SCDL_PATH
>>> - * @param appScdl URL to the SCDL defining the application
>>> + *
>>> + * @see METAINF_APPLICATION_SCDL_PATH
>>> + * @param appScdl
>>> + * URL to the SCDL defining the application
>>> * @return a CompositeComponent for the newly booted
>>> application
>>> * @throws LoaderException
>>> */
>>> @@ -156,12 +161,21 @@
>>> CompositeImplementation impl = new
>>> CompositeImplementation();
>>> impl.setScdlLocation(appScdl);
>>> impl.setClassLoader(applicationLoader);
>>> - ComponentDefinition<CompositeImplementation>
>>> moduleDefinition =
>>> - new ComponentDefinition<CompositeImplementation>
>>> (ComponentNames.TUSCANY_SYSTEM, impl);
>>> + ComponentDefinition<CompositeImplementation>
>>> moduleDefinition = new ComponentDefinition<CompositeImplementation>(
>>> + ComponentNames.TUSCANY_SYSTEM, impl);
>>>
>>> // deploy the component into the runtime under the
>>> system parent
>>> CompositeComponent parent = runtime.getRootComponent();
>>> - return (CompositeComponent<?>) deployer.deploy(parent,
>>> moduleDefinition);
>>> + ClassLoader ccl = Thread.currentThread
>>> ().getContextClassLoader();
>>> +
>>> + try {
>>> +
>>> + Thread.currentThread().setContextClassLoader(getClass
>>> ().getClassLoader());
>>> +
>>> + return (CompositeComponent<?>) deployer.deploy
>>> (parent, moduleDefinition);
>>> + } finally {
>>> + Thread.currentThread().setContextClassLoader(ccl);
>>> + }
>>> }
>>>
>>> public File getInstallDirectory() {
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: svn commit: r429905 - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/
core/src/main/java/org/apache/tuscany/core/launcher/
Posted by cr22rc <cr...@gmail.com>.
Switched the Launcher context thread so it the same as the current
loader. This is so axis has stax provider... maybe a better way in
the future
Without this Axis code doesn't seem to find an implementation for Stax.
Jeremy Boynes wrote:
> The deployer should never need the TCCL to be adjusted. What is the
> issue with Axis during the deployment phase that requires this to be set?
>
> --
> Jeremy
>
> On Aug 8, 2006, at 5:47 PM, rineholt@apache.org wrote:
>
>> Author: rineholt
>> Date: Tue Aug 8 17:47:33 2006
>> New Revision: 429905
>>
>> URL: http://svn.apache.org/viewvc?rev=429905&view=rev
>> Log:
>> Switched the Launcher context thread so it the same as the current
>> loader. This is so axis has stax provider... maybe a better way in
>> the future
>> For axis reference use the java inteface specified in the reference
>> scdl for the interface for autowire .. this is a bad hack.. I think
>> need a way to opt out of autowire where it may not make sense.
>>
>>
>> Modified:
>>
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>
>>
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>
>>
>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>>
>>
>> Modified:
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>>
>> URL:
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java?rev=429905&r1=429904&r2=429905&view=diff
>>
>> ==============================================================================
>>
>> ---
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>> (original)
>> +++
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
>> Tue Aug 8 17:47:33 2006
>> @@ -19,6 +19,7 @@
>> import org.apache.tuscany.spi.extension.BindingBuilderExtension;
>> import org.apache.tuscany.spi.model.BoundReferenceDefinition;
>> import org.apache.tuscany.spi.model.BoundServiceDefinition;
>> +import org.apache.tuscany.spi.model.ServiceContract;
>>
>> /**
>> * Builds a {@link org.osoa.sca.annotations.Service} or {@link
>> org.apache.tuscany.spi.component.Reference} configured
>> @@ -47,11 +48,13 @@
>>
>> BoundReferenceDefinition<WebServiceBinding> boundReferenceDefinition,
>> DeploymentContext deploymentContext) {
>> WebServiceBinding wsBinding =
>> boundReferenceDefinition.getBinding();
>> +
>> return new Axis2Reference(
>> boundReferenceDefinition.getName(),
>> parent,
>> wireService,
>> - wsBinding);
>> + wsBinding,
>> + boundReferenceDefinition.getServiceContract());
>> }
>>
>> protected Class<WebServiceBinding> getBindingType() {
>>
>> Modified:
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>>
>> URL:
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java?rev=429905&r1=429904&r2=429905&view=diff
>>
>> ==============================================================================
>>
>> ---
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>> (original)
>> +++
>> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
>> Tue Aug 8 17:47:33 2006
>> @@ -23,6 +23,7 @@
>>
>> import org.apache.tuscany.spi.component.CompositeComponent;
>> import org.apache.tuscany.spi.extension.ReferenceExtension;
>> +import org.apache.tuscany.spi.model.ServiceContract;
>> import org.apache.tuscany.spi.wire.TargetInvoker;
>> import org.apache.tuscany.spi.wire.WireService;
>>
>> @@ -50,13 +51,23 @@
>>
>> private WebServicePortMetaData wsPortMetaData;
>> private ServiceClient serviceClient;
>> +
>> + public Axis2Reference(String theName,
>> + CompositeComponent<?> parent,
>> + WireService wireService,
>> + WebServiceBinding wsBinding) {
>> + this(theName,parent, wireService, wsBinding, null);
>> + }
>>
>> public Axis2Reference(String theName,
>> CompositeComponent<?> parent,
>> WireService wireService,
>> - WebServiceBinding wsBinding) {
>> + WebServiceBinding wsBinding,
>> ServiceContract contract) {
>> super(theName, parent, wireService);
>> try {
>> + if(null != contract){
>> + setInterface((Class<T>)contract.getInterfaceClass());
>> + }
>> Definition wsdlDefinition = wsBinding.getWSDLDefinition();
>> wsPortMetaData =
>> new WebServicePortMetaData(wsdlDefinition,
>> wsBinding.getWSDLPort(), wsBinding.getURI(), false);
>>
>> Modified:
>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>>
>> URL:
>> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java?rev=429905&r1=429904&r2=429905&view=diff
>>
>> ==============================================================================
>>
>> ---
>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>> (original)
>> +++
>> incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
>> Tue Aug 8 17:47:33 2006
>> @@ -37,32 +37,35 @@
>>
>> /**
>> * Basic launcher implementation.
>> - *
>> + *
>> * @version $Rev: 417136 $ $Date: 2006-06-26 03:54:48 -0400 (Mon, 26
>> Jun 2006) $
>> */
>> public class Launcher {
>> /**
>> * A conventional META-INF based location for the system SCDL.
>> - *
>> + *
>> * @see #bootRuntime(URL, MonitorFactory)
>> */
>> public static final String METAINF_SYSTEM_SCDL_PATH =
>> "META-INF/tuscany/system.scdl";
>>
>> /**
>> * A conventional META-INF based location for the application SCDL.
>> - *
>> + *
>> * @see #bootApplication(URL)
>> */
>> public static final String METAINF_APPLICATION_SCDL_PATH =
>> "META-INF/sca/default.scdl";
>>
>> private ClassLoader applicationLoader;
>> +
>> private RuntimeComponent runtime;
>> +
>> private Deployer deployer;
>> +
>> private CompositeComponent<?> composite;
>>
>> /**
>> * Returns the classloader for application classes.
>> - *
>> + *
>> * @return the classloader for application classes
>> */
>> public ClassLoader getApplicationLoader() {
>> @@ -70,10 +73,11 @@
>> }
>>
>> /**
>> - * Set the classloader to be used for application classes. You
>> should almost always supply your own
>> - * application classloader, based on the hosting environment
>> that the runtime is embedded in.
>> - *
>> - * @param applicationLoader the classloader to be used for
>> application classes
>> + * Set the classloader to be used for application classes. You
>> should almost always supply your own application classloader, based
>> on the hosting
>> + * environment that the runtime is embedded in.
>> + *
>> + * @param applicationLoader
>> + * the classloader to be used for application classes
>> */
>> public void setApplicationLoader(ClassLoader applicationLoader) {
>> this.applicationLoader = applicationLoader;
>> @@ -81,8 +85,9 @@
>>
>> /**
>> * Boots the runtime defined by the specified SCDL.
>> - *
>> - * @param systemScdl a resource path to the SCDL defining the
>> system.
>> + *
>> + * @param systemScdl
>> + * a resource path to the SCDL defining the system.
>> * @return a CompositeComponent for the newly booted runtime system
>> * @throws LoaderException
>> */
>> @@ -109,9 +114,8 @@
>> SystemCompositeImplementation moduleImplementation = new
>> SystemCompositeImplementation();
>> moduleImplementation.setScdlLocation(systemScdl);
>> moduleImplementation.setClassLoader(systemClassLoader);
>> - ComponentDefinition<SystemCompositeImplementation>
>> moduleDefinition =
>> - new
>> ComponentDefinition<SystemCompositeImplementation>(ComponentNames.TUSCANY_SYSTEM,
>>
>> -
>> moduleImplementation);
>> + ComponentDefinition<SystemCompositeImplementation>
>> moduleDefinition = new
>> ComponentDefinition<SystemCompositeImplementation>(
>> + ComponentNames.TUSCANY_SYSTEM, moduleImplementation);
>>
>> // deploy the component into the runtime under the system
>> parent
>> composite = (CompositeComponent<?>)
>> bootDeployer.deploy(parent, moduleDefinition);
>> @@ -140,9 +144,10 @@
>>
>> /**
>> * Boots the application defined by the specified SCDL.
>> - *
>> - * @see METAINF_APPLICATION_SCDL_PATH
>> - * @param appScdl URL to the SCDL defining the application
>> + *
>> + * @see METAINF_APPLICATION_SCDL_PATH
>> + * @param appScdl
>> + * URL to the SCDL defining the application
>> * @return a CompositeComponent for the newly booted application
>> * @throws LoaderException
>> */
>> @@ -156,12 +161,21 @@
>> CompositeImplementation impl = new CompositeImplementation();
>> impl.setScdlLocation(appScdl);
>> impl.setClassLoader(applicationLoader);
>> - ComponentDefinition<CompositeImplementation> moduleDefinition =
>> - new
>> ComponentDefinition<CompositeImplementation>(ComponentNames.TUSCANY_SYSTEM,
>> impl);
>> + ComponentDefinition<CompositeImplementation>
>> moduleDefinition = new ComponentDefinition<CompositeImplementation>(
>> + ComponentNames.TUSCANY_SYSTEM, impl);
>>
>> // deploy the component into the runtime under the system
>> parent
>> CompositeComponent parent = runtime.getRootComponent();
>> - return (CompositeComponent<?>) deployer.deploy(parent,
>> moduleDefinition);
>> + ClassLoader ccl =
>> Thread.currentThread().getContextClassLoader();
>> +
>> + try {
>> +
>> +
>> Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
>>
>> +
>> + return (CompositeComponent<?>) deployer.deploy(parent,
>> moduleDefinition);
>> + } finally {
>> + Thread.currentThread().setContextClassLoader(ccl);
>> + }
>> }
>>
>> public File getInstallDirectory() {
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: svn commit: r429905 - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/ core/src/main/java/org/apache/tuscany/core/launcher/
Posted by Jeremy Boynes <jb...@apache.org>.
The deployer should never need the TCCL to be adjusted. What is the
issue with Axis during the deployment phase that requires this to be
set?
--
Jeremy
On Aug 8, 2006, at 5:47 PM, rineholt@apache.org wrote:
> Author: rineholt
> Date: Tue Aug 8 17:47:33 2006
> New Revision: 429905
>
> URL: http://svn.apache.org/viewvc?rev=429905&view=rev
> Log:
> Switched the Launcher context thread so it the same as the current
> loader. This is so axis has stax provider... maybe a better way in
> the future
> For axis reference use the java inteface specified in the reference
> scdl for the interface for autowire .. this is a bad hack.. I think
> need a way to opt out of autowire where it may not make sense.
>
>
> Modified:
> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/
> org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
> incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/
> org/apache/tuscany/binding/axis2/Axis2Reference.java
> incubator/tuscany/java/sca/core/src/main/java/org/apache/
> tuscany/core/launcher/Launcher.java
>
> Modified: incubator/tuscany/java/sca/bindings/binding.axis2/src/
> main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/
> bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/
> axis2/Axis2BindingBuilder.java?
> rev=429905&r1=429904&r2=429905&view=diff
> ======================================================================
> ========
> --- incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/
> org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java (original)
> +++ incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/
> org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java Tue Aug
> 8 17:47:33 2006
> @@ -19,6 +19,7 @@
> import org.apache.tuscany.spi.extension.BindingBuilderExtension;
> import org.apache.tuscany.spi.model.BoundReferenceDefinition;
> import org.apache.tuscany.spi.model.BoundServiceDefinition;
> +import org.apache.tuscany.spi.model.ServiceContract;
>
> /**
> * Builds a {@link org.osoa.sca.annotations.Service} or {@link
> org.apache.tuscany.spi.component.Reference} configured
> @@ -47,11 +48,13 @@
>
> BoundReferenceDefinition<WebServiceBinding> boundReferenceDefinition,
> DeploymentContext deploymentContext) {
> WebServiceBinding wsBinding =
> boundReferenceDefinition.getBinding();
> +
> return new Axis2Reference(
> boundReferenceDefinition.getName(),
> parent,
> wireService,
> - wsBinding);
> + wsBinding,
> + boundReferenceDefinition.getServiceContract());
> }
>
> protected Class<WebServiceBinding> getBindingType() {
>
> Modified: incubator/tuscany/java/sca/bindings/binding.axis2/src/
> main/java/org/apache/tuscany/binding/axis2/Axis2Reference.java
> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/
> bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/
> axis2/Axis2Reference.java?rev=429905&r1=429904&r2=429905&view=diff
> ======================================================================
> ========
> --- incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/
> org/apache/tuscany/binding/axis2/Axis2Reference.java (original)
> +++ incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/
> org/apache/tuscany/binding/axis2/Axis2Reference.java Tue Aug 8
> 17:47:33 2006
> @@ -23,6 +23,7 @@
>
> import org.apache.tuscany.spi.component.CompositeComponent;
> import org.apache.tuscany.spi.extension.ReferenceExtension;
> +import org.apache.tuscany.spi.model.ServiceContract;
> import org.apache.tuscany.spi.wire.TargetInvoker;
> import org.apache.tuscany.spi.wire.WireService;
>
> @@ -50,13 +51,23 @@
>
> private WebServicePortMetaData wsPortMetaData;
> private ServiceClient serviceClient;
> +
> + public Axis2Reference(String theName,
> + CompositeComponent<?> parent,
> + WireService wireService,
> + WebServiceBinding wsBinding) {
> + this(theName,parent, wireService, wsBinding, null);
> + }
>
> public Axis2Reference(String theName,
> CompositeComponent<?> parent,
> WireService wireService,
> - WebServiceBinding wsBinding) {
> + WebServiceBinding wsBinding,
> ServiceContract contract) {
> super(theName, parent, wireService);
> try {
> + if(null != contract){
> + setInterface((Class<T>)contract.getInterfaceClass());
> + }
> Definition wsdlDefinition = wsBinding.getWSDLDefinition
> ();
> wsPortMetaData =
> new WebServicePortMetaData(wsdlDefinition,
> wsBinding.getWSDLPort(), wsBinding.getURI(), false);
>
> Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/
> tuscany/core/launcher/Launcher.java
> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/
> src/main/java/org/apache/tuscany/core/launcher/Launcher.java?
> rev=429905&r1=429904&r2=429905&view=diff
> ======================================================================
> ========
> --- incubator/tuscany/java/sca/core/src/main/java/org/apache/
> tuscany/core/launcher/Launcher.java (original)
> +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/
> tuscany/core/launcher/Launcher.java Tue Aug 8 17:47:33 2006
> @@ -37,32 +37,35 @@
>
> /**
> * Basic launcher implementation.
> - *
> + *
> * @version $Rev: 417136 $ $Date: 2006-06-26 03:54:48 -0400 (Mon,
> 26 Jun 2006) $
> */
> public class Launcher {
> /**
> * A conventional META-INF based location for the system SCDL.
> - *
> + *
> * @see #bootRuntime(URL, MonitorFactory)
> */
> public static final String METAINF_SYSTEM_SCDL_PATH = "META-
> INF/tuscany/system.scdl";
>
> /**
> * A conventional META-INF based location for the application
> SCDL.
> - *
> + *
> * @see #bootApplication(URL)
> */
> public static final String METAINF_APPLICATION_SCDL_PATH =
> "META-INF/sca/default.scdl";
>
> private ClassLoader applicationLoader;
> +
> private RuntimeComponent runtime;
> +
> private Deployer deployer;
> +
> private CompositeComponent<?> composite;
>
> /**
> * Returns the classloader for application classes.
> - *
> + *
> * @return the classloader for application classes
> */
> public ClassLoader getApplicationLoader() {
> @@ -70,10 +73,11 @@
> }
>
> /**
> - * Set the classloader to be used for application classes.
> You should almost always supply your own
> - * application classloader, based on the hosting environment
> that the runtime is embedded in.
> - *
> - * @param applicationLoader the classloader to be used for
> application classes
> + * Set the classloader to be used for application classes. You
> should almost always supply your own application classloader, based
> on the hosting
> + * environment that the runtime is embedded in.
> + *
> + * @param applicationLoader
> + * the classloader to be used for application classes
> */
> public void setApplicationLoader(ClassLoader applicationLoader) {
> this.applicationLoader = applicationLoader;
> @@ -81,8 +85,9 @@
>
> /**
> * Boots the runtime defined by the specified SCDL.
> - *
> - * @param systemScdl a resource path to the SCDL defining the
> system.
> + *
> + * @param systemScdl
> + * a resource path to the SCDL defining the system.
> * @return a CompositeComponent for the newly booted runtime
> system
> * @throws LoaderException
> */
> @@ -109,9 +114,8 @@
> SystemCompositeImplementation moduleImplementation = new
> SystemCompositeImplementation();
> moduleImplementation.setScdlLocation(systemScdl);
> moduleImplementation.setClassLoader(systemClassLoader);
> - ComponentDefinition<SystemCompositeImplementation>
> moduleDefinition =
> - new
> ComponentDefinition<SystemCompositeImplementation>
> (ComponentNames.TUSCANY_SYSTEM,
> -
> moduleImplementation);
> + ComponentDefinition<SystemCompositeImplementation>
> moduleDefinition = new
> ComponentDefinition<SystemCompositeImplementation>(
> + ComponentNames.TUSCANY_SYSTEM, moduleImplementation);
>
> // deploy the component into the runtime under the system
> parent
> composite = (CompositeComponent<?>) bootDeployer.deploy
> (parent, moduleDefinition);
> @@ -140,9 +144,10 @@
>
> /**
> * Boots the application defined by the specified SCDL.
> - *
> - * @see METAINF_APPLICATION_SCDL_PATH
> - * @param appScdl URL to the SCDL defining the application
> + *
> + * @see METAINF_APPLICATION_SCDL_PATH
> + * @param appScdl
> + * URL to the SCDL defining the application
> * @return a CompositeComponent for the newly booted application
> * @throws LoaderException
> */
> @@ -156,12 +161,21 @@
> CompositeImplementation impl = new CompositeImplementation();
> impl.setScdlLocation(appScdl);
> impl.setClassLoader(applicationLoader);
> - ComponentDefinition<CompositeImplementation>
> moduleDefinition =
> - new ComponentDefinition<CompositeImplementation>
> (ComponentNames.TUSCANY_SYSTEM, impl);
> + ComponentDefinition<CompositeImplementation>
> moduleDefinition = new ComponentDefinition<CompositeImplementation>(
> + ComponentNames.TUSCANY_SYSTEM, impl);
>
> // deploy the component into the runtime under the system
> parent
> CompositeComponent parent = runtime.getRootComponent();
> - return (CompositeComponent<?>) deployer.deploy(parent,
> moduleDefinition);
> + ClassLoader ccl = Thread.currentThread
> ().getContextClassLoader();
> +
> + try {
> +
> + Thread.currentThread().setContextClassLoader(getClass
> ().getClassLoader());
> +
> + return (CompositeComponent<?>) deployer.deploy(parent,
> moduleDefinition);
> + } finally {
> + Thread.currentThread().setContextClassLoader(ccl);
> + }
> }
>
> public File getInstallDirectory() {
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org