How can I create a JCAConnector programmatically?

View: New views
3 Messages — Rating Filter:   Alert me  

How can I create a JCAConnector programmatically?

by nlif :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

First, congrats on the 2.0 release :-)

I'd like to be able to create JCAConnector programmatically, but I can't figure out how to do this. The connector looks for a String "ref" that should point to a bean-name in the Spring configuration. I could subclass DefaultEndpointFactory to override createMessageListener(), but I can't find a way to plug my class instead of DefaultEndpointFactory, because it is created in JCAConnector.start().

Is there a solution?

Thanks in adavnce,
Naaman

Just to clarify - I want to be able to create the connector on the fly, and provide the *instance* of the MessageListener. I know I can create the connector instance, and have it look for the bean-name if the Spring configs, but that's not what I need...




Re: How can I create a JCAConnector programmatically?

by gnodet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You could do something like the following:

        JCAConnector jcaConnector = new JCAConnector();
        jcaConnector.setActivationSpec(activationSpec);
        jcaConnector.setEndpointFactory(endpointFactory);
        jcaConnector.setResourceAdapter(resourceAdapter);
        jcaConnector.afterPropertiesSet();

But you could also write:
        resourceAdapter.endpointActivation(endpointFactory, activationSpec);

You can also take a look at what servicemix does for example:
http://fisheye3.cenqua.com/browse/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlow.java?r=470813#l589



On 1/10/07, nlif <naaman@...> wrote:

>
> Hi all,
>
> First, congrats on the 2.0 release :-)
>
> I'd like to be able to create JCAConnector programmatically, but I can't
> figure out how to do this. The connector looks for a String "ref" that
> should point to a bean-name in the Spring configuration. I could subclass
> DefaultEndpointFactory to override createMessageListener(), but I can't find
> a way to plug my class instead of DefaultEndpointFactory, because it is
> created in JCAConnector.start().
>
> Is there a solution?
>
> Thanks in adavnce,
> Naaman
>
>
> --
> View this message in context: http://www.nabble.com/How-can-I-create-a-JCAConnector-programmatically--tf2952870.html#a8258820
> Sent from the jencks - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


--
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: How can I create a JCAConnector programmatically?

by nlif :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks!

This seems to be exactly what I need. I'll give it a try...