You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by goldi <go...@freenet.de> on 2007/05/14 20:04:43 UTC

Programmatically adding SU or BC?

Hi everybody,

is it possible to add an SU or BC programmatically? I would like to have a
method like this:

public void addSU(){

FileSenderEndpoint fileSender=new FileSender(..,..);

//set some properties to fileSender
//install fileSender on ServiceMix

}

This method I would like to call within ServiceMix. 


greets Goldi
-- 
View this message in context: http://www.nabble.com/Programmatically-adding-SU-or-BC--tf3753963s12049.html#a10609052
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Programmatically adding SU or BC?

Posted by Guillaume Nodet <gn...@gmail.com>.
This is what is done in junit test.  Take a look at the unit tests for the
servicemix-file components ...  To retreive the component, something like

   container.getComponent("servicemix-file").getComponent()

On 5/14/07, goldi <go...@freenet.de> wrote:
>
>
> Ok I understand. Is there pherhaps a short code-snippet?
>
>
> gnodet wrote:
> >
> > Sure ! There is an addEndpoint method available on the components.
> > You should be able to retrieve the component by using the internal
> > ServiceMix registry and cast it to FileComponent.
> >
> > On 5/14/07, goldi <go...@freenet.de> wrote:
> >>
> >>
> >> Hi everybody,
> >>
> >> is it possible to add an SU or BC programmatically? I would like to
> have
> >> a
> >> method like this:
> >>
> >> public void addSU(){
> >>
> >> FileSenderEndpoint fileSender=new FileSender(..,..);
> >>
> >> //set some properties to fileSender
> >> //install fileSender on ServiceMix
> >>
> >> }
> >>
> >> This method I would like to call within ServiceMix.
> >>
> >>
> >> greets Goldi
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Programmatically-adding-SU-or-BC--tf3753963s12049.html#a10609052
> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Principal Engineer, IONA
> > Blog: http://gnodet.blogspot.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Programmatically-adding-SU-or-BC--tf3753963s12049.html#a10609520
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: Programmatically adding SU or BC?

Posted by goldi <go...@freenet.de>.
Ok I understand. Is there pherhaps a short code-snippet?


gnodet wrote:
> 
> Sure ! There is an addEndpoint method available on the components.
> You should be able to retrieve the component by using the internal
> ServiceMix registry and cast it to FileComponent.
> 
> On 5/14/07, goldi <go...@freenet.de> wrote:
>>
>>
>> Hi everybody,
>>
>> is it possible to add an SU or BC programmatically? I would like to have
>> a
>> method like this:
>>
>> public void addSU(){
>>
>> FileSenderEndpoint fileSender=new FileSender(..,..);
>>
>> //set some properties to fileSender
>> //install fileSender on ServiceMix
>>
>> }
>>
>> This method I would like to call within ServiceMix.
>>
>>
>> greets Goldi
>> --
>> View this message in context:
>> http://www.nabble.com/Programmatically-adding-SU-or-BC--tf3753963s12049.html#a10609052
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Programmatically-adding-SU-or-BC--tf3753963s12049.html#a10609520
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Guillaume Nodet <gn...@gmail.com>.
Not sure why the excpetion is thrown, but your solution would not work.
First, the syntax for the classpath is

<location>xxx</location>

as explained at http://incubator.apache.org/servicemix/classloaders.html
Then, if your code runs inside servicemix-ftp, you do not have to worry
about the classloader,
and if you're not inside servicemix-ftp, class loaders would be isolated (
i.e. the endpoint class loaded
by your classloader would not be the same as the class loaded by
servicemix-ftp and you will ultimately
have a ClassCastException).

I would really recommend trying to write an endpoint poller that does not
run by itself, but only
when it receives a message.  You should inherit the ProviderEndpoint and
reuse the existing ftp
endpoint as much as possible (copying).  Then implement the ftp polling
logic when the endpoint
processes an InOut request.


On 5/16/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
>
> I returned to this topic and am trying to create an FtpPollerEndpoint
> dynamically per your original advice (not the URIResolver method but
> the initial reponse in this thread of creating and manually adding
> the endpoint) but am getting the following exception:
>
> java.lang.NoClassDefFoundError: org/apache/servicemix/ftp/
> FtpPollerEndpoint
>          at
> com.mediaspansoftware.transporter.servicemix.FTPGatewayEndpoint.process(
> FTPGatewayEndpoint.java:116)
>          at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess
> (AsyncBaseLifeCycle.java:489)
>          at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange
> (AsyncBaseLifeCycle.java:441)
>          at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange
> (BaseLifeCycle.java:46)
>          at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound
> (DeliveryChannelImpl.java:593)
>          at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting
> (AbstractFlow.java:174)
>          at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting
> (SedaFlow.java:176)
>          at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run
> (SedaQueue.java:134)
>          at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor
> $Worker.runTask(ThreadPoolExecutor.java:665)
>          at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor
> $Worker.run(ThreadPoolExecutor.java:690)
>          at java.lang.Thread.run(Thread.java:613)
>
> The servicemix-ftp SE has been installed and the log shows it
> starting up:
>
> INFO  - ComponentMBeanImpl             - Setting running state for
> Component: servicemix-ftp to Started
> INFO  - ComponentMBeanImpl             - Initializing component:
> servicemix-ftp
>
> Why would I get this exception? I tried adding a classpath to the
> SU's xbean for this SE:
>
>      <property id="serverRootDirectory"
>          label="%servicemix30.installation.path" type="directory"
>          context="runtime" default="/Users/johnsos/MediaSpan/Develop/
> Tools/apache-servicemix-3.1-incubating" />
>
>      <classpath>
>          <archive path="${serverRootDirectory}/data/smx/components/
> servicemix-ftp/version_1/lib/servicemix-ftp-3.1-incubating.jar" />
>      </classpath>
>
> But I still get the exception...is there something wrong with my config?
>
> Thanks,
> Scott
>
> On May 14, 2007, at 3:09 PM, Guillaume Nodet wrote:
>
> > Hum, sorry. This will currently only work for provider endpoints, not
> > consumers.
> > This could work if we have a provider endpoint polling for ftp
> > files on
> > demand (using an OutOnly mep ?).
> > And it seems this is what you really need, but this had not been
> > implemented
> > yet.
> > We have already talked about that several times and I think this
> > would be a
> > nice
> > addition.  This would be very interesting for bindings on top of file
> > systems.  I guess
> > we could define a nice wsdl with a list / get / put / delete /
> > rename /...
> > operations.
> >
> >
> > On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
> >>
> >> So, as I understand this, I get a reference to the servicemix-ftp
> >> context via the registry then create this dynamic endpoint but what
> >> am I getting for the endpoint? An FtpPollerEndpoint (which is what
> >> I'd need) or a more vanilla endpoint upon which I can perform FTP
> >> operations (send or receive)?
> >>
> >> On May 14, 2007, at 2:54 PM, Guillaume Nodet wrote:
> >>
> >> > You could use dynamic endpoints :-)
> >> > They are resolved dynamically by using
> >> >  DocumentFragement epr = URIResolver.createWSAEPR("ftp://xxx");
> >> >  ServiceEndpoint ep = componentContext.resolveEndpointReference
> >> (epr)
> >> >
> >> > It will create an endpoint dynamically when you send an exchange to
> >> > this
> >> > ServiceEndpoint.
> >> >
> >> >
> >> > On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
> >> >>
> >> >> This plays into something I'd like to try...so given this
> >> knowledge,
> >> >> how reasonble is it to perform this operation on the fly:
> >> >>
> >> >> 1. Request comes in to perform a business process.
> >> >> 2. My Custom SE recieves request and parses process parameters,
> >> >> notices that an FTP polling operation is needed to get input.
> >> >> 3. Custom SE forwards to my own custom FTP "gateway" component
> >> >> 4. FTP Gateway creates an endpoint as described below for the
> >> >> servicemix-ftp component, specifying the parameters such as
> >> host and
> >> >> directory as needed for the current process.
> >> >> 5. The newly-created FTP endpoint performs the act (it's sent a
> >> >> message from my FTP Gateway synchronously so we know when it's
> >> >> finished to get the results).
> >> >> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no
> >> longer
> >> >> needed.
> >> >> 7. FTP Gateway forwards message to the next endpoint in my task's
> >> >> workflow.
> >> >>
> >> >> Does this make any sense and is it reasonble/possible to do?
> >> >>
> >> >> (This would be in lieu of the ability to modify an endpoint's
> >> >> configuration at runtime.)
> >> >>
> >> >> Thanks,
> >> >> Scott
> >> >>
> >> >>
> >> >> On May 14, 2007, at 2:06 PM, Guillaume Nodet wrote:
> >> >>
> >> >> > Sure ! There is an addEndpoint method available on the
> >> components.
> >> >> > You should be able to retrieve the component by using the
> >> internal
> >> >> > ServiceMix registry and cast it to FileComponent.
> >> >> >
> >> >> > On 5/14/07, goldi <go...@freenet.de> wrote:
> >> >> >>
> >> >> >>
> >> >> >> Hi everybody,
> >> >> >>
> >> >> >> is it possible to add an SU or BC programmatically? I would
> >> like
> >> >> >> to have a
> >> >> >> method like this:
> >> >> >>
> >> >> >> public void addSU(){
> >> >> >>
> >> >> >> FileSenderEndpoint fileSender=new FileSender(..,..);
> >> >> >>
> >> >> >> //set some properties to fileSender
> >> >> >> //install fileSender on ServiceMix
> >> >> >>
> >> >> >> }
> >> >> >>
> >> >> >> This method I would like to call within ServiceMix.
> >> >> >>
> >> >> >>
> >> >> >> greets Goldi
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >> http://www.nabble.com/Programmatically-adding-SU-or-BC--
> >> >> >> tf3753963s12049.html#a10609052
> >> >> >> Sent from the ServiceMix - User mailing list archive at
> >> >> Nabble.com.
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Cheers,
> >> >> > Guillaume Nodet
> >> >> > ------------------------
> >> >> > Principal Engineer, IONA
> >> >> > Blog: http://gnodet.blogspot.com/
> >> >>
> >> >>
> >> >>
> >> >> Scott Johnson, Software Developer
> >> >> MediaSpan Media Software
> >> >> sjohnson@mediaspansoftware.com
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Cheers,
> >> > Guillaume Nodet
> >> > ------------------------
> >> > Principal Engineer, IONA
> >> > Blog: http://gnodet.blogspot.com/
> >>
> >>
> >>
> >> Scott Johnson, Software Developer
> >> MediaSpan Media Software
> >> sjohnson@mediaspansoftware.com
> >>
> >>
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Principal Engineer, IONA
> > Blog: http://gnodet.blogspot.com/
>
>
>
> Scott Johnson, Software Developer
> MediaSpan Media Software
> sjohnson@mediaspansoftware.com
>
>
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Scott Johnson <sj...@mediaspansoftware.com>.
I returned to this topic and am trying to create an FtpPollerEndpoint  
dynamically per your original advice (not the URIResolver method but  
the initial reponse in this thread of creating and manually adding  
the endpoint) but am getting the following exception:

java.lang.NoClassDefFoundError: org/apache/servicemix/ftp/ 
FtpPollerEndpoint
         at  
com.mediaspansoftware.transporter.servicemix.FTPGatewayEndpoint.process( 
FTPGatewayEndpoint.java:116)
         at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess 
(AsyncBaseLifeCycle.java:489)
         at  
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange 
(AsyncBaseLifeCycle.java:441)
         at  
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange 
(BaseLifeCycle.java:46)
         at  
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound 
(DeliveryChannelImpl.java:593)
         at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting 
(AbstractFlow.java:174)
         at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting 
(SedaFlow.java:176)
         at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run 
(SedaQueue.java:134)
         at  
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor 
$Worker.runTask(ThreadPoolExecutor.java:665)
         at  
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor 
$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Thread.java:613)

The servicemix-ftp SE has been installed and the log shows it  
starting up:

INFO  - ComponentMBeanImpl             - Setting running state for  
Component: servicemix-ftp to Started
INFO  - ComponentMBeanImpl             - Initializing component:  
servicemix-ftp

Why would I get this exception? I tried adding a classpath to the  
SU's xbean for this SE:

     <property id="serverRootDirectory"
         label="%servicemix30.installation.path" type="directory"
         context="runtime" default="/Users/johnsos/MediaSpan/Develop/ 
Tools/apache-servicemix-3.1-incubating" />

     <classpath>
         <archive path="${serverRootDirectory}/data/smx/components/ 
servicemix-ftp/version_1/lib/servicemix-ftp-3.1-incubating.jar" />
     </classpath>

But I still get the exception...is there something wrong with my config?

Thanks,
Scott

On May 14, 2007, at 3:09 PM, Guillaume Nodet wrote:

> Hum, sorry. This will currently only work for provider endpoints, not
> consumers.
> This could work if we have a provider endpoint polling for ftp  
> files on
> demand (using an OutOnly mep ?).
> And it seems this is what you really need, but this had not been  
> implemented
> yet.
> We have already talked about that several times and I think this  
> would be a
> nice
> addition.  This would be very interesting for bindings on top of file
> systems.  I guess
> we could define a nice wsdl with a list / get / put / delete /  
> rename /...
> operations.
>
>
> On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
>>
>> So, as I understand this, I get a reference to the servicemix-ftp
>> context via the registry then create this dynamic endpoint but what
>> am I getting for the endpoint? An FtpPollerEndpoint (which is what
>> I'd need) or a more vanilla endpoint upon which I can perform FTP
>> operations (send or receive)?
>>
>> On May 14, 2007, at 2:54 PM, Guillaume Nodet wrote:
>>
>> > You could use dynamic endpoints :-)
>> > They are resolved dynamically by using
>> >  DocumentFragement epr = URIResolver.createWSAEPR("ftp://xxx");
>> >  ServiceEndpoint ep = componentContext.resolveEndpointReference 
>> (epr)
>> >
>> > It will create an endpoint dynamically when you send an exchange to
>> > this
>> > ServiceEndpoint.
>> >
>> >
>> > On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
>> >>
>> >> This plays into something I'd like to try...so given this  
>> knowledge,
>> >> how reasonble is it to perform this operation on the fly:
>> >>
>> >> 1. Request comes in to perform a business process.
>> >> 2. My Custom SE recieves request and parses process parameters,
>> >> notices that an FTP polling operation is needed to get input.
>> >> 3. Custom SE forwards to my own custom FTP "gateway" component
>> >> 4. FTP Gateway creates an endpoint as described below for the
>> >> servicemix-ftp component, specifying the parameters such as  
>> host and
>> >> directory as needed for the current process.
>> >> 5. The newly-created FTP endpoint performs the act (it's sent a
>> >> message from my FTP Gateway synchronously so we know when it's
>> >> finished to get the results).
>> >> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no  
>> longer
>> >> needed.
>> >> 7. FTP Gateway forwards message to the next endpoint in my task's
>> >> workflow.
>> >>
>> >> Does this make any sense and is it reasonble/possible to do?
>> >>
>> >> (This would be in lieu of the ability to modify an endpoint's
>> >> configuration at runtime.)
>> >>
>> >> Thanks,
>> >> Scott
>> >>
>> >>
>> >> On May 14, 2007, at 2:06 PM, Guillaume Nodet wrote:
>> >>
>> >> > Sure ! There is an addEndpoint method available on the  
>> components.
>> >> > You should be able to retrieve the component by using the  
>> internal
>> >> > ServiceMix registry and cast it to FileComponent.
>> >> >
>> >> > On 5/14/07, goldi <go...@freenet.de> wrote:
>> >> >>
>> >> >>
>> >> >> Hi everybody,
>> >> >>
>> >> >> is it possible to add an SU or BC programmatically? I would  
>> like
>> >> >> to have a
>> >> >> method like this:
>> >> >>
>> >> >> public void addSU(){
>> >> >>
>> >> >> FileSenderEndpoint fileSender=new FileSender(..,..);
>> >> >>
>> >> >> //set some properties to fileSender
>> >> >> //install fileSender on ServiceMix
>> >> >>
>> >> >> }
>> >> >>
>> >> >> This method I would like to call within ServiceMix.
>> >> >>
>> >> >>
>> >> >> greets Goldi
>> >> >> --
>> >> >> View this message in context:
>> >> >> http://www.nabble.com/Programmatically-adding-SU-or-BC--
>> >> >> tf3753963s12049.html#a10609052
>> >> >> Sent from the ServiceMix - User mailing list archive at
>> >> Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > Cheers,
>> >> > Guillaume Nodet
>> >> > ------------------------
>> >> > Principal Engineer, IONA
>> >> > Blog: http://gnodet.blogspot.com/
>> >>
>> >>
>> >>
>> >> Scott Johnson, Software Developer
>> >> MediaSpan Media Software
>> >> sjohnson@mediaspansoftware.com
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> > --
>> > Cheers,
>> > Guillaume Nodet
>> > ------------------------
>> > Principal Engineer, IONA
>> > Blog: http://gnodet.blogspot.com/
>>
>>
>>
>> Scott Johnson, Software Developer
>> MediaSpan Media Software
>> sjohnson@mediaspansoftware.com
>>
>>
>>
>>
>
>
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/



Scott Johnson, Software Developer
MediaSpan Media Software
sjohnson@mediaspansoftware.com




Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Guillaume Nodet <gn...@gmail.com>.
Hum, sorry. This will currently only work for provider endpoints, not
consumers.
This could work if we have a provider endpoint polling for ftp files on
demand (using an OutOnly mep ?).
And it seems this is what you really need, but this had not been implemented
yet.
We have already talked about that several times and I think this would be a
nice
addition.  This would be very interesting for bindings on top of file
systems.  I guess
we could define a nice wsdl with a list / get / put / delete / rename /...
operations.


On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
>
> So, as I understand this, I get a reference to the servicemix-ftp
> context via the registry then create this dynamic endpoint but what
> am I getting for the endpoint? An FtpPollerEndpoint (which is what
> I'd need) or a more vanilla endpoint upon which I can perform FTP
> operations (send or receive)?
>
> On May 14, 2007, at 2:54 PM, Guillaume Nodet wrote:
>
> > You could use dynamic endpoints :-)
> > They are resolved dynamically by using
> >  DocumentFragement epr = URIResolver.createWSAEPR("ftp://xxx");
> >  ServiceEndpoint ep = componentContext.resolveEndpointReference(epr)
> >
> > It will create an endpoint dynamically when you send an exchange to
> > this
> > ServiceEndpoint.
> >
> >
> > On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
> >>
> >> This plays into something I'd like to try...so given this knowledge,
> >> how reasonble is it to perform this operation on the fly:
> >>
> >> 1. Request comes in to perform a business process.
> >> 2. My Custom SE recieves request and parses process parameters,
> >> notices that an FTP polling operation is needed to get input.
> >> 3. Custom SE forwards to my own custom FTP "gateway" component
> >> 4. FTP Gateway creates an endpoint as described below for the
> >> servicemix-ftp component, specifying the parameters such as host and
> >> directory as needed for the current process.
> >> 5. The newly-created FTP endpoint performs the act (it's sent a
> >> message from my FTP Gateway synchronously so we know when it's
> >> finished to get the results).
> >> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no longer
> >> needed.
> >> 7. FTP Gateway forwards message to the next endpoint in my task's
> >> workflow.
> >>
> >> Does this make any sense and is it reasonble/possible to do?
> >>
> >> (This would be in lieu of the ability to modify an endpoint's
> >> configuration at runtime.)
> >>
> >> Thanks,
> >> Scott
> >>
> >>
> >> On May 14, 2007, at 2:06 PM, Guillaume Nodet wrote:
> >>
> >> > Sure ! There is an addEndpoint method available on the components.
> >> > You should be able to retrieve the component by using the internal
> >> > ServiceMix registry and cast it to FileComponent.
> >> >
> >> > On 5/14/07, goldi <go...@freenet.de> wrote:
> >> >>
> >> >>
> >> >> Hi everybody,
> >> >>
> >> >> is it possible to add an SU or BC programmatically? I would like
> >> >> to have a
> >> >> method like this:
> >> >>
> >> >> public void addSU(){
> >> >>
> >> >> FileSenderEndpoint fileSender=new FileSender(..,..);
> >> >>
> >> >> //set some properties to fileSender
> >> >> //install fileSender on ServiceMix
> >> >>
> >> >> }
> >> >>
> >> >> This method I would like to call within ServiceMix.
> >> >>
> >> >>
> >> >> greets Goldi
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Programmatically-adding-SU-or-BC--
> >> >> tf3753963s12049.html#a10609052
> >> >> Sent from the ServiceMix - User mailing list archive at
> >> Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Cheers,
> >> > Guillaume Nodet
> >> > ------------------------
> >> > Principal Engineer, IONA
> >> > Blog: http://gnodet.blogspot.com/
> >>
> >>
> >>
> >> Scott Johnson, Software Developer
> >> MediaSpan Media Software
> >> sjohnson@mediaspansoftware.com
> >>
> >>
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Principal Engineer, IONA
> > Blog: http://gnodet.blogspot.com/
>
>
>
> Scott Johnson, Software Developer
> MediaSpan Media Software
> sjohnson@mediaspansoftware.com
>
>
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Scott Johnson <sj...@mediaspansoftware.com>.
So, as I understand this, I get a reference to the servicemix-ftp  
context via the registry then create this dynamic endpoint but what  
am I getting for the endpoint? An FtpPollerEndpoint (which is what  
I'd need) or a more vanilla endpoint upon which I can perform FTP  
operations (send or receive)?

On May 14, 2007, at 2:54 PM, Guillaume Nodet wrote:

> You could use dynamic endpoints :-)
> They are resolved dynamically by using
>  DocumentFragement epr = URIResolver.createWSAEPR("ftp://xxx");
>  ServiceEndpoint ep = componentContext.resolveEndpointReference(epr)
>
> It will create an endpoint dynamically when you send an exchange to  
> this
> ServiceEndpoint.
>
>
> On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
>>
>> This plays into something I'd like to try...so given this knowledge,
>> how reasonble is it to perform this operation on the fly:
>>
>> 1. Request comes in to perform a business process.
>> 2. My Custom SE recieves request and parses process parameters,
>> notices that an FTP polling operation is needed to get input.
>> 3. Custom SE forwards to my own custom FTP "gateway" component
>> 4. FTP Gateway creates an endpoint as described below for the
>> servicemix-ftp component, specifying the parameters such as host and
>> directory as needed for the current process.
>> 5. The newly-created FTP endpoint performs the act (it's sent a
>> message from my FTP Gateway synchronously so we know when it's
>> finished to get the results).
>> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no longer
>> needed.
>> 7. FTP Gateway forwards message to the next endpoint in my task's
>> workflow.
>>
>> Does this make any sense and is it reasonble/possible to do?
>>
>> (This would be in lieu of the ability to modify an endpoint's
>> configuration at runtime.)
>>
>> Thanks,
>> Scott
>>
>>
>> On May 14, 2007, at 2:06 PM, Guillaume Nodet wrote:
>>
>> > Sure ! There is an addEndpoint method available on the components.
>> > You should be able to retrieve the component by using the internal
>> > ServiceMix registry and cast it to FileComponent.
>> >
>> > On 5/14/07, goldi <go...@freenet.de> wrote:
>> >>
>> >>
>> >> Hi everybody,
>> >>
>> >> is it possible to add an SU or BC programmatically? I would like
>> >> to have a
>> >> method like this:
>> >>
>> >> public void addSU(){
>> >>
>> >> FileSenderEndpoint fileSender=new FileSender(..,..);
>> >>
>> >> //set some properties to fileSender
>> >> //install fileSender on ServiceMix
>> >>
>> >> }
>> >>
>> >> This method I would like to call within ServiceMix.
>> >>
>> >>
>> >> greets Goldi
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Programmatically-adding-SU-or-BC--
>> >> tf3753963s12049.html#a10609052
>> >> Sent from the ServiceMix - User mailing list archive at  
>> Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > Cheers,
>> > Guillaume Nodet
>> > ------------------------
>> > Principal Engineer, IONA
>> > Blog: http://gnodet.blogspot.com/
>>
>>
>>
>> Scott Johnson, Software Developer
>> MediaSpan Media Software
>> sjohnson@mediaspansoftware.com
>>
>>
>>
>>
>
>
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/



Scott Johnson, Software Developer
MediaSpan Media Software
sjohnson@mediaspansoftware.com




Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Guillaume Nodet <gn...@gmail.com>.
You could use dynamic endpoints :-)
They are resolved dynamically by using
  DocumentFragement epr = URIResolver.createWSAEPR("ftp://xxx");
  ServiceEndpoint ep = componentContext.resolveEndpointReference(epr)

It will create an endpoint dynamically when you send an exchange to this
ServiceEndpoint.


On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
>
> This plays into something I'd like to try...so given this knowledge,
> how reasonble is it to perform this operation on the fly:
>
> 1. Request comes in to perform a business process.
> 2. My Custom SE recieves request and parses process parameters,
> notices that an FTP polling operation is needed to get input.
> 3. Custom SE forwards to my own custom FTP "gateway" component
> 4. FTP Gateway creates an endpoint as described below for the
> servicemix-ftp component, specifying the parameters such as host and
> directory as needed for the current process.
> 5. The newly-created FTP endpoint performs the act (it's sent a
> message from my FTP Gateway synchronously so we know when it's
> finished to get the results).
> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no longer
> needed.
> 7. FTP Gateway forwards message to the next endpoint in my task's
> workflow.
>
> Does this make any sense and is it reasonble/possible to do?
>
> (This would be in lieu of the ability to modify an endpoint's
> configuration at runtime.)
>
> Thanks,
> Scott
>
>
> On May 14, 2007, at 2:06 PM, Guillaume Nodet wrote:
>
> > Sure ! There is an addEndpoint method available on the components.
> > You should be able to retrieve the component by using the internal
> > ServiceMix registry and cast it to FileComponent.
> >
> > On 5/14/07, goldi <go...@freenet.de> wrote:
> >>
> >>
> >> Hi everybody,
> >>
> >> is it possible to add an SU or BC programmatically? I would like
> >> to have a
> >> method like this:
> >>
> >> public void addSU(){
> >>
> >> FileSenderEndpoint fileSender=new FileSender(..,..);
> >>
> >> //set some properties to fileSender
> >> //install fileSender on ServiceMix
> >>
> >> }
> >>
> >> This method I would like to call within ServiceMix.
> >>
> >>
> >> greets Goldi
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Programmatically-adding-SU-or-BC--
> >> tf3753963s12049.html#a10609052
> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Principal Engineer, IONA
> > Blog: http://gnodet.blogspot.com/
>
>
>
> Scott Johnson, Software Developer
> MediaSpan Media Software
> sjohnson@mediaspansoftware.com
>
>
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by goldi <go...@freenet.de>.
Hey Scott,

what you described, is very similar to the case what I will have to perform.

greets Goldi

Scott Johnson-16 wrote:
> 
> This plays into something I'd like to try...so given this knowledge,  
> how reasonble is it to perform this operation on the fly:
> 
> 1. Request comes in to perform a business process.
> 2. My Custom SE recieves request and parses process parameters,  
> notices that an FTP polling operation is needed to get input.
> 3. Custom SE forwards to my own custom FTP "gateway" component
> 4. FTP Gateway creates an endpoint as described below for the  
> servicemix-ftp component, specifying the parameters such as host and  
> directory as needed for the current process.
> 5. The newly-created FTP endpoint performs the act (it's sent a  
> message from my FTP Gateway synchronously so we know when it's  
> finished to get the results).
> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no longer  
> needed.
> 7. FTP Gateway forwards message to the next endpoint in my task's  
> workflow.
> 
> Does this make any sense and is it reasonble/possible to do?
> 
> (This would be in lieu of the ability to modify an endpoint's  
> configuration at runtime.)
> 
> Thanks,
> Scott
> 
> 
> On May 14, 2007, at 2:06 PM, Guillaume Nodet wrote:
> 
>> Sure ! There is an addEndpoint method available on the components.
>> You should be able to retrieve the component by using the internal
>> ServiceMix registry and cast it to FileComponent.
>>
>> On 5/14/07, goldi <go...@freenet.de> wrote:
>>>
>>>
>>> Hi everybody,
>>>
>>> is it possible to add an SU or BC programmatically? I would like  
>>> to have a
>>> method like this:
>>>
>>> public void addSU(){
>>>
>>> FileSenderEndpoint fileSender=new FileSender(..,..);
>>>
>>> //set some properties to fileSender
>>> //install fileSender on ServiceMix
>>>
>>> }
>>>
>>> This method I would like to call within ServiceMix.
>>>
>>>
>>> greets Goldi
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Programmatically-adding-SU-or-BC-- 
>>> tf3753963s12049.html#a10609052
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>> -- 
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Principal Engineer, IONA
>> Blog: http://gnodet.blogspot.com/
> 
> 
> 
> Scott Johnson, Software Developer
> MediaSpan Media Software
> sjohnson@mediaspansoftware.com
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Programmatically-adding-SU-or-BC--tf3753963s12049.html#a10609657
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Scott Johnson <sj...@mediaspansoftware.com>.
I need to do it dynamically because I could get multiple requests  
that come in, each one wanting to poll from a different FTP host/ 
directory. My application is targeted for customers who do not want  
to know (and shouldn't have to) how to setup an SU. They create a  
"task" that my application understands and will perform using the  
underlying technology (here ServiceMix) to do the work.

If I could create a single SU and configure it on-the-fly for each  
request that would be ideal. But I'm getting the feeling that's not  
possible (but I'm still very new to this technology).

-Scott

On May 14, 2007, at 2:41 PM, Bruce Snyder wrote:

> On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
>> This plays into something I'd like to try...so given this knowledge,
>> how reasonble is it to perform this operation on the fly:
>>
>> 1. Request comes in to perform a business process.
>> 2. My Custom SE recieves request and parses process parameters,
>> notices that an FTP polling operation is needed to get input.
>> 3. Custom SE forwards to my own custom FTP "gateway" component
>> 4. FTP Gateway creates an endpoint as described below for the
>> servicemix-ftp component, specifying the parameters such as host and
>> directory as needed for the current process.
>> 5. The newly-created FTP endpoint performs the act (it's sent a
>> message from my FTP Gateway synchronously so we know when it's
>> finished to get the results).
>> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no longer
>> needed.
>> 7. FTP Gateway forwards message to the next endpoint in my task's
>> workflow.
>>
>> Does this make any sense and is it reasonble/possible to do?
>>
>> (This would be in lieu of the ability to modify an endpoint's
>> configuration at runtime.)
>
> You can certainly do this programatically via the API, but my first
> question is about the need to do this dynamically. Why do this
> dynamically when you can just configure a SU that is always deployed?
> What's the advantage to doing this dynamically for every request vs. a
> statically configured (xbean.xml) SU?
>
> Bruce
> -- 
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\! 
> G;6%I;\"YC;VT*"
> );'
>
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/



Scott Johnson, Software Developer
MediaSpan Media Software
sjohnson@mediaspansoftware.com




Re: Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Bruce Snyder <br...@gmail.com>.
On 5/14/07, Scott Johnson <sj...@mediaspansoftware.com> wrote:
> This plays into something I'd like to try...so given this knowledge,
> how reasonble is it to perform this operation on the fly:
>
> 1. Request comes in to perform a business process.
> 2. My Custom SE recieves request and parses process parameters,
> notices that an FTP polling operation is needed to get input.
> 3. Custom SE forwards to my own custom FTP "gateway" component
> 4. FTP Gateway creates an endpoint as described below for the
> servicemix-ftp component, specifying the parameters such as host and
> directory as needed for the current process.
> 5. The newly-created FTP endpoint performs the act (it's sent a
> message from my FTP Gateway synchronously so we know when it's
> finished to get the results).
> 6. FTP Gateway disposes of the adhoc FTP endpoint as it's no longer
> needed.
> 7. FTP Gateway forwards message to the next endpoint in my task's
> workflow.
>
> Does this make any sense and is it reasonble/possible to do?
>
> (This would be in lieu of the ability to modify an endpoint's
> configuration at runtime.)

You can certainly do this programatically via the API, but my first
question is about the need to do this dynamically. Why do this
dynamically when you can just configure a SU that is always deployed?
What's the advantage to doing this dynamically for every request vs. a
statically configured (xbean.xml) SU?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Dynamic Endpoints: (Forked from Re: Programmatically adding SU or BC?)

Posted by Scott Johnson <sj...@mediaspansoftware.com>.
This plays into something I'd like to try...so given this knowledge,  
how reasonble is it to perform this operation on the fly:

1. Request comes in to perform a business process.
2. My Custom SE recieves request and parses process parameters,  
notices that an FTP polling operation is needed to get input.
3. Custom SE forwards to my own custom FTP "gateway" component
4. FTP Gateway creates an endpoint as described below for the  
servicemix-ftp component, specifying the parameters such as host and  
directory as needed for the current process.
5. The newly-created FTP endpoint performs the act (it's sent a  
message from my FTP Gateway synchronously so we know when it's  
finished to get the results).
6. FTP Gateway disposes of the adhoc FTP endpoint as it's no longer  
needed.
7. FTP Gateway forwards message to the next endpoint in my task's  
workflow.

Does this make any sense and is it reasonble/possible to do?

(This would be in lieu of the ability to modify an endpoint's  
configuration at runtime.)

Thanks,
Scott


On May 14, 2007, at 2:06 PM, Guillaume Nodet wrote:

> Sure ! There is an addEndpoint method available on the components.
> You should be able to retrieve the component by using the internal
> ServiceMix registry and cast it to FileComponent.
>
> On 5/14/07, goldi <go...@freenet.de> wrote:
>>
>>
>> Hi everybody,
>>
>> is it possible to add an SU or BC programmatically? I would like  
>> to have a
>> method like this:
>>
>> public void addSU(){
>>
>> FileSenderEndpoint fileSender=new FileSender(..,..);
>>
>> //set some properties to fileSender
>> //install fileSender on ServiceMix
>>
>> }
>>
>> This method I would like to call within ServiceMix.
>>
>>
>> greets Goldi
>> --
>> View this message in context:
>> http://www.nabble.com/Programmatically-adding-SU-or-BC-- 
>> tf3753963s12049.html#a10609052
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
>
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/



Scott Johnson, Software Developer
MediaSpan Media Software
sjohnson@mediaspansoftware.com




Re: Programmatically adding SU or BC?

Posted by Guillaume Nodet <gn...@gmail.com>.
Sure ! There is an addEndpoint method available on the components.
You should be able to retrieve the component by using the internal
ServiceMix registry and cast it to FileComponent.

On 5/14/07, goldi <go...@freenet.de> wrote:
>
>
> Hi everybody,
>
> is it possible to add an SU or BC programmatically? I would like to have a
> method like this:
>
> public void addSU(){
>
> FileSenderEndpoint fileSender=new FileSender(..,..);
>
> //set some properties to fileSender
> //install fileSender on ServiceMix
>
> }
>
> This method I would like to call within ServiceMix.
>
>
> greets Goldi
> --
> View this message in context:
> http://www.nabble.com/Programmatically-adding-SU-or-BC--tf3753963s12049.html#a10609052
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/