jve.generated
Class DataSourceService

java.lang.Object
  extended byjve.generated.DataSourceService
All Implemented Interfaces:
IDataSourceService

public class DataSourceService
extends java.lang.Object
implements IDataSourceService

Default implementation of IDataSourceService.


Constructor Summary
DataSourceService(java.beans.PropertyChangeListener argsListener)
           
 
Method Summary
 void actionPerformed(IActionBinder action)
          Reacts to some action performed on this data source service.
 java.lang.Class getClass(java.lang.String clazz)
           
 IDataSource getDataSource()
          Get the Data Source associated with this action.
 ObjectReference getServiceArgument()
          Get the argument used as the parameter for the service call.
 java.lang.String getServiceSignature()
          Get the service signature for this action.
 java.lang.Class getType()
          Get the return type of the service call
 java.lang.Object invokeDataSourceService()
          Use the service provider to retrive an object.
 void refresh()
          Refresh the data source service.
 void setDataSource(IDataSource source)
          Set the Data Source associated with this action.
 void setServiceArgument(ObjectReference arg)
          Set the argument for the service call, according to the method signature set with the setService method.
 void setServiceSignature(java.lang.String service)
          This is the service method signature that is to be use.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSourceService

public DataSourceService(java.beans.PropertyChangeListener argsListener)
Method Detail

setDataSource

public void setDataSource(IDataSource source)
Description copied from interface: IDataSourceService
Set the Data Source associated with this action.

Specified by:
setDataSource in interface IDataSourceService
Parameters:
source - DataSource to use for this service

getDataSource

public IDataSource getDataSource()
Description copied from interface: IDataSourceService
Get the Data Source associated with this action.

Specified by:
getDataSource in interface IDataSourceService
Returns:
The Data Source used for this service

getClass

public java.lang.Class getClass(java.lang.String clazz)
                         throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

setServiceSignature

public void setServiceSignature(java.lang.String service)
                         throws java.lang.IllegalArgumentException
Description copied from interface: IDataSourceService
This is the service method signature that is to be use. It has to be complete including parameter types e.g. getUserRecord(Integer id);

Specified by:
setServiceSignature in interface IDataSourceService
Parameters:
service - signature
Throws:
java.lang.IllegalArgumentException

getServiceSignature

public java.lang.String getServiceSignature()
Description copied from interface: IDataSourceService
Get the service signature for this action.

Specified by:
getServiceSignature in interface IDataSourceService
Returns:
service signature

setServiceArgument

public void setServiceArgument(ObjectReference arg)
Description copied from interface: IDataSourceService
Set the argument for the service call, according to the method signature set with the setService method.

Specified by:
setServiceArgument in interface IDataSourceService
Parameters:
arg - the service argument

getServiceArgument

public ObjectReference getServiceArgument()
Description copied from interface: IDataSourceService
Get the argument used as the parameter for the service call.

Specified by:
getServiceArgument in interface IDataSourceService
Returns:
argument used for the service

toString

public java.lang.String toString()

invokeDataSourceService

public java.lang.Object invokeDataSourceService()
                                         throws java.lang.IllegalStateException
Use the service provider to retrive an object. Assume service/args are already set

Returns:
service result
Throws:
java.lang.IllegalStateException - if there's an error invoking the service

actionPerformed

public void actionPerformed(IActionBinder action)
Reacts to some action performed on this data source service. This implmenetation simply passes the action onto all of the service's argument objects.

Parameters:
action - the action performed

getType

public java.lang.Class getType()
                        throws java.lang.IllegalStateException
Get the return type of the service call

Returns:
the return type
Throws:
java.lang.IllegalStateException - if the service isn't properly set up or there was a reflection exception

refresh

public void refresh()
Refresh the data source service.
This implementation simply refreshes all of the service arguments.