raccoon.tibco.tibrv.badhnati.ae
Class TibrvAeParser

java.lang.Object
  extended by raccoon.core.types.AbsComponent
      extended by raccoon.core.types.AbsLoadable
          extended by raccoon.core.types.AbsConfigurableLoadable
              extended by raccoon.tibco.tibrv.badhnati.ae.TibrvAeParser
All Implemented Interfaces:
IBaseComponent, IConfigurable, ILoadable, ILogable, ITibrvMsgParser

public class TibrvAeParser
extends AbsConfigurableLoadable
implements ITibrvMsgParser

Converts java beans to IBusMessage instances or vice-versa.

Since:
Raccoon v0.7
Version:
$Id: TibrvAeParser.java,v 1.3 2003/07/01 17:42:14 crouvrais Exp $
Author:
Cedric ROUVRAIS

Field Summary
 
Fields inherited from class raccoon.core.types.AbsConfigurableLoadable
mConfigurableManager
 
Fields inherited from class raccoon.core.types.AbsLoadable
mIsLoaded
 
Fields inherited from class raccoon.core.types.AbsComponent
mIsInError
 
Constructor Summary
TibrvAeParser()
          Default constructor, required for dynamic instanciation
 
Method Summary
 java.lang.Object bindFrom(com.tibco.tibrv.TibrvMsg pTibrvMsg)
          Converts the provided IBusMessage instance into the corresponding java bean instance.
 com.tibco.tibrv.TibrvMsg bindTo(java.lang.Object pJavaBean)
          Converts a java bean into a valid TIB/Rendezvous message.
 void cload()
          Invoked by the service manager to start this component once it has been configured.
 void configureParameters()
          Configures the various parameters for this component.
 IBeanAnalyzer getAnalyzer()
          The bean introspector used by this component to retrieve serializable information.
 IFactory getFactory()
          Retrieves the factory instance used to instanciate empty message objects.
 IRepoGenerator getRepoGenerator()
          TIB/Repository generator service used to create TIB/Repository compliant URLs according to the Raccoon specification.
 IUtils getUtils()
          The messaging layer utility service
 boolean isInvokeAdder()
          Should this parser invoke the adder instead of the setter for collection methods.
 boolean isLogable()
          This component requires a logging service.
 void load()
          Loads or initializes the component.
 IMessage marshal(java.lang.Object pJavaBean)
          Converts a given java bean instance into a IBusMessage instance.
 void setAnalyzer(IBeanAnalyzer pAnalyzer)
          Assigns the IBeanAnalyzer instance required by this component
 void setFactory(IFactory pFactory)
          Assigns the IFactory used to instanciate empty message objects.
 void setInvokeAdder(boolean pInvokeAdder)
          Defines the mutator preference method for collections.
 void setRepoGenerator(IRepoGenerator pRepoGenerator)
          TIB/Repository generator service used to create TIB/Repository compliant URLs according to the Raccoon specification.
 void setUtils(IUtils pUtils)
          Assigns the message layer utility service
 java.lang.Object unmarshal(IMessage pMessage)
          Converts the provided IBusMessage instance into the corresponding java bean instance.
 
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable
isStable, setConfigurableManager, setLogger
 
Methods inherited from class raccoon.core.types.AbsLoadable
getLog, isInError, isInitialised, isRunning, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TibrvAeParser

public TibrvAeParser()
Default constructor, required for dynamic instanciation

Method Detail

configureParameters

public void configureParameters()
Configures the various parameters for this component. This method should configure the instance of IConfigurableManager provided during the invocation of AbsConfigurableLoadable.setConfigurableManager(IConfigurableManager).

Specified by:
configureParameters in interface IConfigurable
Overrides:
configureParameters in class AbsConfigurableLoadable

isLogable

public boolean isLogable()
This component requires a logging service.

Returns:
true as this component needs a logging component.

isInvokeAdder

public boolean isInvokeAdder()
Should this parser invoke the adder instead of the setter for collection methods.

Returns:
true if the adder will be invoked rather than the setter.

setInvokeAdder

public void setInvokeAdder(boolean pInvokeAdder)
                    throws ResourceNotFoundException
Defines the mutator preference method for collections.

Parameters:
pInvokeAdder - should the adder be invoked in preference to the setter.
Throws:
ResourceNotFoundException - if the property named InvokeAdder was not found.

getUtils

public IUtils getUtils()
The messaging layer utility service

Returns:
the instance of IUtils used

setUtils

public void setUtils(IUtils pUtils)
              throws ResourceNotFoundException
Assigns the message layer utility service

Parameters:
pUtils - the implementation of IUtils to use
Throws:
ResourceNotFoundException - if the property named Utils was not found.

getAnalyzer

public IBeanAnalyzer getAnalyzer()
The bean introspector used by this component to retrieve serializable information.

Returns:
the IBeanAnalyzer instance used by this component

setAnalyzer

public void setAnalyzer(IBeanAnalyzer pAnalyzer)
                 throws ResourceNotFoundException
Assigns the IBeanAnalyzer instance required by this component

Parameters:
pAnalyzer - the instance defined in the Service Manager configuration file
Throws:
ResourceNotFoundException - if the property named Analyzer was not found.

getRepoGenerator

public IRepoGenerator getRepoGenerator()
TIB/Repository generator service used to create TIB/Repository compliant URLs according to the Raccoon specification.

Returns:
the instance used by this component

setRepoGenerator

public void setRepoGenerator(IRepoGenerator pRepoGenerator)
                      throws ResourceNotFoundException
TIB/Repository generator service used to create TIB/Repository compliant URLs according to the Raccoon specification.

Parameters:
pRepoGenerator - the instance to be used by this component
Throws:
ResourceNotFoundException - if the property named RepoGenerator was not found.

getFactory

public IFactory getFactory()
Retrieves the factory instance used to instanciate empty message objects.

Returns:
the IFactory instance used

setFactory

public void setFactory(IFactory pFactory)
                throws ResourceNotFoundException
Assigns the IFactory used to instanciate empty message objects.

Parameters:
pFactory - the factory instance to use.
Throws:
ResourceNotFoundException - if the property named RepoGenerator was not found.

marshal

public IMessage marshal(java.lang.Object pJavaBean)
                 throws RaccoonException
Converts a given java bean instance into a IBusMessage instance.

Parameters:
pJavaBean - the java bean instance
Returns:
the IBusMessage instance.
Throws:
RaccoonException - if the java bean is invalid, or if this component isn't loaded.

unmarshal

public java.lang.Object unmarshal(IMessage pMessage)
                           throws RaccoonException
Converts the provided IBusMessage instance into the corresponding java bean instance.

Parameters:
pMessage - the message to be converted
Returns:
the result of the conversion
Throws:
RaccoonException - if this component isn't loaded.
RaccoonException - if the conversion fails.

bindFrom

public java.lang.Object bindFrom(com.tibco.tibrv.TibrvMsg pTibrvMsg)
                          throws RaccoonException
Converts the provided IBusMessage instance into the corresponding java bean instance.

Specified by:
bindFrom in interface ITibrvMsgParser
Parameters:
pTibrvMsg - the TIB/Rendezvous message containing a serialized java bean.
Returns:
the deserialized java bean.
Throws:
RaccoonException - if this component isn't loaded.

bindTo

public com.tibco.tibrv.TibrvMsg bindTo(java.lang.Object pJavaBean)
                                throws RaccoonException
Converts a java bean into a valid TIB/Rendezvous message.

Specified by:
bindTo in interface ITibrvMsgParser
Parameters:
pJavaBean - the java bean instance to convert.
Returns:
the TIB/Rendezvous message.
Throws:
RaccoonException - if the conversion process fails.

load

public void load()
          throws java.lang.IllegalStateException,
                 LoadableException
Loads or initializes the component.

Specified by:
load in interface ILoadable
Overrides:
load in class AbsConfigurableLoadable
Throws:
LoadableException - if the component couldn't load itself.
java.lang.IllegalStateException - if the component isn't in a state to load itself. for example it is already loaded.

cload

public void cload()
           throws RaccoonException
Invoked by the service manager to start this component once it has been configured. When extended bare in mind that the member variable mIsInitialised should be set to false and then set to true once all the init code has been performed.

Throws:
RaccoonException - if this component isn't initialisable or is already running.


Copyright null null. All Rights Reserved.