org.ow2.petals.engine.sampleclient
Class SampleClient

java.lang.Object
  extended by org.ow2.petals.engine.sampleclient.SampleClient
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle

public class SampleClient
extends java.lang.Object
implements javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle

Main class of the SampleClient component, this client is used to manage a container and to test it

Author:
alouis, ddesjardins - eBMWebsourcing, Marc Dutoo - Open Wide

Field Summary
static java.lang.String INONLY
           
static java.lang.String INOPTIONALOUT
           
static java.lang.String INOUT
           
static java.lang.String ROBUSTINONLY
           
 
Constructor Summary
SampleClient()
           
 
Method Summary
protected  org.xml.sax.InputSource createSource(java.lang.String msg)
          Create a source from a string
protected  org.w3c.dom.DocumentFragment createWSAToDocFrag(java.lang.String wsaToValue)
          Create the WSA:TO document fragment
 java.lang.String getAsReference(javax.jbi.servicedesc.ServiceEndpoint se)
           
 java.lang.String getDescription(javax.jbi.servicedesc.ServiceEndpoint se)
          Get the service description
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints()
           
 javax.management.ObjectName getExtensionMBeanName()
           
 java.lang.String getInterfaces(javax.jbi.servicedesc.ServiceEndpoint se)
          Get the service interfaces
 javax.jbi.component.ComponentLifeCycle getLifeCycle()
           
 org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint arg0)
           
 javax.jbi.component.ServiceUnitManager getServiceUnitManager()
           
 void init(javax.jbi.component.ComponentContext context)
           
 boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint arg0, javax.jbi.messaging.MessageExchange arg1)
           
 boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint arg0, javax.jbi.messaging.MessageExchange arg1)
           
 javax.jbi.servicedesc.ServiceEndpoint resolveDescription(java.lang.String text)
           
 javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(org.w3c.dom.DocumentFragment arg0)
           
 void send(java.lang.String itf, java.lang.String service, java.lang.String op, java.lang.String endpoint, java.lang.String content, java.lang.String type, java.util.List<java.io.File> attachmentFiles, java.lang.String properties, long syncTime)
          Sends a message through Petals JBI
 void shutDown()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INONLY

public static final java.lang.String INONLY
See Also:
Constant Field Values

INOUT

public static final java.lang.String INOUT
See Also:
Constant Field Values

INOPTIONALOUT

public static final java.lang.String INOPTIONALOUT
See Also:
Constant Field Values

ROBUSTINONLY

public static final java.lang.String ROBUSTINONLY
See Also:
Constant Field Values
Constructor Detail

SampleClient

public SampleClient()
Method Detail

init

public void init(javax.jbi.component.ComponentContext context)
          throws javax.jbi.JBIException
Specified by:
init in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

start

public void start()
           throws javax.jbi.JBIException
Specified by:
start in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

stop

public void stop()
          throws javax.jbi.JBIException
Specified by:
stop in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

shutDown

public void shutDown()
              throws javax.jbi.JBIException
Specified by:
shutDown in interface javax.jbi.component.ComponentLifeCycle
Throws:
javax.jbi.JBIException

getLifeCycle

public javax.jbi.component.ComponentLifeCycle getLifeCycle()
Specified by:
getLifeCycle in interface javax.jbi.component.Component

getServiceDescription

public org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint arg0)
Specified by:
getServiceDescription in interface javax.jbi.component.Component

getServiceUnitManager

public javax.jbi.component.ServiceUnitManager getServiceUnitManager()
Specified by:
getServiceUnitManager in interface javax.jbi.component.Component

isExchangeWithConsumerOkay

public boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint arg0,
                                          javax.jbi.messaging.MessageExchange arg1)
Specified by:
isExchangeWithConsumerOkay in interface javax.jbi.component.Component

isExchangeWithProviderOkay

public boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint arg0,
                                          javax.jbi.messaging.MessageExchange arg1)
Specified by:
isExchangeWithProviderOkay in interface javax.jbi.component.Component

resolveEndpointReference

public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(org.w3c.dom.DocumentFragment arg0)
Specified by:
resolveEndpointReference in interface javax.jbi.component.Component

getExtensionMBeanName

public javax.management.ObjectName getExtensionMBeanName()
Specified by:
getExtensionMBeanName in interface javax.jbi.component.ComponentLifeCycle

send

public void send(java.lang.String itf,
                 java.lang.String service,
                 java.lang.String op,
                 java.lang.String endpoint,
                 java.lang.String content,
                 java.lang.String type,
                 java.util.List<java.io.File> attachmentFiles,
                 java.lang.String properties,
                 long syncTime)
Sends a message through Petals JBI

Parameters:
itf - the target JBI interface, optional if endpoint specified
service - the target JBI service
op -
content - the message content
type -
attachmentFiles - the message's attached files (if any)
properties - the message's properties
syncTime -

getEndpoints

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints()
Returns:

resolveDescription

public javax.jbi.servicedesc.ServiceEndpoint resolveDescription(java.lang.String text)
Parameters:
text -
Returns:

getDescription

public java.lang.String getDescription(javax.jbi.servicedesc.ServiceEndpoint se)
Get the service description

Parameters:
se -
Returns:

getInterfaces

public java.lang.String getInterfaces(javax.jbi.servicedesc.ServiceEndpoint se)
Get the service interfaces

Parameters:
se -
Returns:

getAsReference

public java.lang.String getAsReference(javax.jbi.servicedesc.ServiceEndpoint se)
Parameters:
se -
Returns:

createSource

protected org.xml.sax.InputSource createSource(java.lang.String msg)
Create a source from a string

Parameters:
msg -
Returns:

createWSAToDocFrag

protected org.w3c.dom.DocumentFragment createWSAToDocFrag(java.lang.String wsaToValue)
Create the WSA:TO document fragment

Parameters:
wsaToValue -
Returns:


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.