Well, actually the rootPath is already on the ServiceUnit.
Take a look at the wsdl deployer for example
(org.apache.servicemix.commons.wsdl1.AbstractWsdl1Deployer)
in servicemix-commons.
The deploy method looks like
public ServiceUnit deploy(String serviceUnitName,
String serviceUnitRootPath) throws
DeploymentException {
File[] wsdls = new File(serviceUnitRootPath).listFiles(filter);
if (wsdls == null || wsdls.length == 0) {
throw failure("deploy", "No wsdl found", null);
}
ServiceUnit su = createServiceUnit();
su.setComponent(component);
su.setName(serviceUnitName);
su.setRootPath(serviceUnitRootPath);
for (int i = 0; i < wsdls.length; i++) {
initFromWsdl(su, wsdls[i]);
}
if (su.getEndpoints().size() == 0) {
throw failure("deploy", "Invalid wsdl: no endpoints found", null);
}
return su;
}
On 2/8/07, wizard <[EMAIL PROTECTED]> wrote:
Yes, your logic makes sense.
Still, my SU is composed only of a jbi.xml and a xbean.xml that configures
the SE.
Can you explain in greater detail where do I implement the deploy method
that to keep the SU's rootPath?
gnodet wrote:
>
> I don't understand the problem.
> The canDeploy should not actually perform any operations other
> than checking if the content of the SU is known (for example,
> checking that your xsd exists). Each time a SU is deployed,
> this method will be called with different parameters.
>
> To implement your own deployer, you have to implement
> the deploy method. If you need to keep the root folder for a given
> SU, you need to create a property on your ServiceUnit
> derived class and fill it in the deploy method.
>
> Makes sense ? Or did I miunderstood you ?
>
> On 2/7/07, wizard <[EMAIL PROTECTED]> wrote:
>>
>> Hi!
>>
>> I'm using a SE built by myself, using a template. It is partially
>> working.
>> In method (from xxxxDeployer.java):
>> public boolean canDeploy(String serviceUnitName, String
>> serviceUnitRootPath)
>> {...}
>>
>> my SE receives the SU's root path, when a SU is deployed. Then I use this
>> rootpath to access a .xsd I deploy together with my SU.
>> The problem is, when I deploy a second SU (with a different .xsd), it
>> deploys correctly, but the root path becomes the one of the 2nd SU, not
>> enabling the 1st SU to reach its .xsd file but reaching the 2nd .xsd
>>
>> Any thoughts on a solution for this?
>>
>> Thanks in advance!
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/Service-Engine-serviceUnitRootPath-tf3189306s12049.html#a8853212
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/
>
>
--
View this message in context:
http://www.nabble.com/Service-Engine-serviceUnitRootPath-tf3189306s12049.html#a8862152
Sent from the ServiceMix - User mailing list archive at Nabble.com.
--
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/