You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Venkata Krishnan <fo...@gmail.com> on 2006/08/08 19:38:46 UTC

Inheriting Wiring infrastructure

Hi Jim / Jeremy / Axis2 & Celtix binding folks

Continuing with the simple RMI Binding that I am working on... here are the
things that I have done to move it forward in steps... (from a null inbound
wire to being able to host the RMI Service.  Now I am on the path to
invoking the service).  Here is what I have done in the
RMIBindingBuilder.build method: -

- created the inbound and outbound wires
- set up anInbound and Outbound Invocations chain for these wires resp.
- set up a Java target invoker on the InboundWire (did not understand this
as I expected that this should be set onto the outbound wire)
- Now I am stuck with Interceptors... it seems like the outbound wire need
to be configured with interceptor.  This seems to be little tricky as I must
create MessageChannels and so on... any suggestions on how I could do this?

Axis2 and Celtix folks, how have you guys done this?    If this is not the
way to do this, what else is?

Here is the body of the method RMIBindingBuilder.build : -

MIService rmiService = new RMIService<Remote>(name, parent, wireService,
uri, service);

        Method aMethod = boundServiceDefinition.getServiceContract
().getInterfaceClass().getMethods()[0];

        QualifiedName targetName = new QualifiedName(
boundServiceDefinition.getTarget().getPath());
        JavaAtomicComponent target = (JavaAtomicComponent) parent.getChild(
targetName.getPartName());
        JavaTargetInvoker targetInvoker = new JavaTargetInvoker(aMethod,
target);

        InboundWire inWire = new InboundWireImpl();
        inWire.setBusinessInterface(
boundServiceDefinition.getServiceContract().getInterfaceClass());
        inWire.setServiceName(boundServiceDefinition.getName());
        InboundInvocationChain inInvChain = new
InboundInvocationChainImpl(aMethod);
        inInvChain.setTargetInvoker(targetInvoker);
        inWire.getInvocationChains().put(aMethod, inInvChain);
        rmiService.setInboundWire(inWire);

        OutboundWire outWire = new OutboundWireImpl();
        outWire.setTargetName(new QualifiedName(
boundServiceDefinition.getTarget().getPath()));
        outWire.setBusinessInterface(
boundServiceDefinition.getServiceContract().getInterfaceClass());

        rmiService.setOutboundWire(outWire);
        Interceptor intc = new RequestResponseInterceptor()

        OutboundInvocationChain outInvChain = new
OutboundInvocationChainImpl(aMethod);
        outWire.getInvocationChains().put(aMethod, outInvChain);

        return rmiService;

Thanks

- Venkat

Re: Inheriting Wiring infrastructure

Posted by Jim Marino <jm...@myromatours.com>.
one clarification below...
On Aug 8, 2006, at 7:30 PM, Jim Marino wrote:

>
> On Aug 8, 2006, at 10:38 AM, Venkata Krishnan wrote:
>
>> Hi Jim / Jeremy / Axis2 & Celtix binding folks
>>
>> Continuing with the simple RMI Binding that I am working on...  
>> here are the
>> things that I have done to move it forward in steps... (from a  
>> null inbound
>> wire to being able to host the RMI Service.  Now I am on the path to
>> invoking the service).  Here is what I have done in the
>> RMIBindingBuilder.build method: -
>>
>> - created the inbound and outbound wires
>> - set up anInbound and Outbound Invocations chain for these wires  
>> resp.
>> - set up a Java target invoker on the InboundWire (did not  
>> understand this
>> as I expected that this should be set onto the outbound wire)
> You should only need to create the target invoker for the reference  
> and not the service side (the target invoker is responsible for  
> dispatching on a service). The invoker itself is cached on the  
> target side

Sorry, I should have said the "target invoker is cached on the source  
side"...mistyped.

Jim

> and sent down the invocation chain with the message, pulled off by  
> the final interceptor and invoked. This process is described in the  
> slides under /doc.  The reason for this is so target invokers can  
> be optimized to avoid resolution on every invoke when the source of  
> a wire is of the same or lesser scope than the target (e.g.  
> request-->request; request-->module).



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Inheriting Wiring infrastructure

Posted by Jim Marino <jm...@myromatours.com>.
On Aug 8, 2006, at 10:38 AM, Venkata Krishnan wrote:

> Hi Jim / Jeremy / Axis2 & Celtix binding folks
>
> Continuing with the simple RMI Binding that I am working on... here  
> are the
> things that I have done to move it forward in steps... (from a null  
> inbound
> wire to being able to host the RMI Service.  Now I am on the path to
> invoking the service).  Here is what I have done in the
> RMIBindingBuilder.build method: -
>
> - created the inbound and outbound wires
> - set up anInbound and Outbound Invocations chain for these wires  
> resp.
> - set up a Java target invoker on the InboundWire (did not  
> understand this
> as I expected that this should be set onto the outbound wire)
You should only need to create the target invoker for the reference  
and not the service side (the target invoker is responsible for  
dispatching on a service). The invoker itself is cached on the target  
side and sent down the invocation chain with the message, pulled off  
by the final interceptor and invoked. This process is described in  
the slides under /doc.  The reason for this is so target invokers can  
be optimized to avoid resolution on every invoke when the source of a  
wire is of the same or lesser scope than the target (e.g. request-- 
 >request; request-->module).

> - Now I am stuck with Interceptors... it seems like the outbound  
> wire need
> to be configured with interceptor.  This seems to be little tricky  
> as I must
> create MessageChannels and so on... any suggestions on how I could  
> do this?
>

Yes it's very tricky, particularly with callbacks ;-) The connector  
handles this so the extension developer should not need to worry.

> Axis2 and Celtix folks, how have you guys done this?    If this is  
> not the
> way to do this, what else is?
>
If you give me until tomorrow, I'll check a sample binding in of how  
to do this. I also have some related changes I want to discuss  
pertaining to the Wire Service and how wires are produced so I'll  
post in a related email.

Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org