Package  Use  Tree  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

 

jve.generated
Class DataSourceDataObject

java.lang.Object
  extended byjve.generated.ObjectReference
      extended byjve.generated.BasicDataObject
          extended byjve.generated.DataSourceDataObject

All Implemented Interfaces:
IBoundObject, IDataObject, IDataSourceService


public class DataSourceDataObject
extends BasicDataObject
implements IDataSourceService

Default implementation of a data object that is retrieved by a service call on a Data Source.


Field Summary
protected  boolean initialized
           
 

Fields inherited from class jve.generated.ObjectReference
debug
 

Fields inherited from interface jve.generated.IBoundObject
DELIMITER, PROPERTY_OBJ_CHANGED
 

Constructor Summary
DataSourceDataObject()
           
 

Method Summary
 void actionPerformed(IActionBinder action)
          React to an action that may impact this ActionDataObject and its arguments.
protected  void createObjectFromDataSouce()
          Use the service provider to retrive an object.
 IDataSource getDataSource()
          Get the data source against which the service call will be performed.
 java.lang.Object getObject()
          Get the referenced object.
 ObjectReference getServiceArgument()
          Get an object reference to the service argument.
 java.lang.String getServiceSignature()
          Get the string signature of the service method.
 java.lang.Class getType()
          Get the class type of the referenced data object, which should be the return value of the service method.
 java.lang.Object getValue(java.lang.String property)
          Get the value of the given property from the referenced object.
 boolean isAutoRefresh()
          Get the value of the autoRefresh property.
 void refresh()
          Refresh the value of the referenced object.
 void setAutoRefresh(boolean autoRefresh)
          Sets the autoRefresh property.
 void setDataSource(IDataSource source)
          Set the data source against which the service call will be performed.
 void setServiceArgument(ObjectReference arg)
          Set the service argument for the service call.
 void setServiceSignature(java.lang.String service)
          Set the service method with the given method signature.
 void setSourceObject(java.lang.Object obj)
          Set the object referenced by this data object.
 java.lang.String toString()
          Get a string representation of the ActionDataObject.
 

Methods inherited from class jve.generated.BasicDataObject
firePropertyChanged, getHelper, isPrimitive, isReadOnly, setValue
 

Methods inherited from class jve.generated.ObjectReference
addPropertyChangeListener, addPropertyListeners, firePropertyChanged, getErrorMessage, getProperty, getPureSourceObject, getSourceObject, log, log, refreshPropertyHelper, removePropertyChangeListener, removePropertyListeners, setProperty, setSourceObject
 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Methods inherited from interface jve.generated.IBoundObject
addPropertyChangeListener, getProperty, getSourceObject, removePropertyChangeListener, setProperty, setSourceObject
 

 

Field Detail

 

 

initialized

protected boolean initialized

Constructor Detail

 

 

DataSourceDataObject

public DataSourceDataObject()

Method Detail

 

 

createObjectFromDataSouce

protected void createObjectFromDataSouce()

Use the service provider to retrive an object. Assume service/args are already set

Returns:
service result


 

 

getObject

public java.lang.Object getObject()

Get the referenced object. If the object hasn't been initialized and the service is set up properly, the service will be queried for its value.

Specified by:
getObject in interface IBoundObject
Overrides:
getObject in class ObjectReference

Returns:
resolved object reference.


 

 

refresh

public void refresh()

Refresh the value of the referenced object. This involves querying the service with the current values of the service args. A PropertyChangedEvent will be fired with PROPERTY_OBJ_CHANGED as the property.

Specified by:
refresh in interface IBoundObject
Overrides:
refresh in class BasicDataObject


 

 

setSourceObject

public void setSourceObject(java.lang.Object obj)

Set the object referenced by this data object.

Specified by:
setSourceObject in interface IBoundObject
Overrides:
setSourceObject in class BasicDataObject

Parameters:
obj - the referenced object


 

 

setDataSource

public void setDataSource(IDataSource source)

Set the data source against which the service call will be performed.

Specified by:
setDataSource in interface IDataSourceService

Parameters:
source - provider the data source


 

 

getValue

public java.lang.Object getValue(java.lang.String property)

Get the value of the given property from the referenced object. If the object hasn't been initialized and the service is set up properly, the service will be queried for its value.

Specified by:
getValue in interface IDataObject
Overrides:
getValue in class BasicDataObject

Parameters:
property - the property value to query on the referenced object.
Returns:
the value of the property, or null if there's a problem retrieving the value.


 

 

getServiceSignature

public java.lang.String getServiceSignature()

Get the string signature of the service method.

Specified by:
getServiceSignature in interface IDataSourceService

Returns:
method signature


 

 

setServiceSignature

public void setServiceSignature(java.lang.String service)

Set the service method with the given method signature. The arguments of the method must be included in this method signature. For example: "getEmployeeRecord(Integer id)"

Specified by:
setServiceSignature in interface IDataSourceService

Parameters:
service - the service method signature


 

 

actionPerformed

public void actionPerformed(IActionBinder action)

React to an action that may impact this ActionDataObject and its arguments. This implementation will refresh this ActionDataObject and pass the action onto all of its service arguments.

Specified by:
actionPerformed in interface IBoundObject
Overrides:
actionPerformed in class ObjectReference

Parameters:
action - the action that has occurred.
See Also:
IActionBinder


 

 

setServiceArgument

public void setServiceArgument(ObjectReference arg)

Set the service argument for the service call. Currently, ActionDataObjects only support service methods with a single argument.

Specified by:
setServiceArgument in interface IDataSourceService

Parameters:
arg - an object reference to the service argument.


 

 

toString

public java.lang.String toString()

Get a string representation of the ActionDataObject.

Overrides:
toString in class BasicDataObject

Returns:
a string representation


 

 

getServiceArgument

public ObjectReference getServiceArgument()

Get an object reference to the service argument.

Specified by:
getServiceArgument in interface IDataSourceService

Returns:
the service argument


 

 

getDataSource

public IDataSource getDataSource()

Get the data source against which the service call will be performed.

Specified by:
getDataSource in interface IDataSourceService

Returns:
the data source


 

 

getType

public java.lang.Class getType()
                        throws java.lang.IllegalStateException

Get the class type of the referenced data object, which should be the return value of the service method.

Specified by:
getType in interface IBoundObject
Overrides:
getType in class ObjectReference

Returns:
the class type
Throws:
java.io.InvalidObjectException - if the service is not properly configured or the type can't be resolved.
java.lang.IllegalStateException


 

 

isAutoRefresh

public boolean isAutoRefresh()

Get the value of the autoRefresh property.

Returns:
Returns the autoRefresh.
See Also:
setAutoRefresh(boolean)


 

 

setAutoRefresh

public void setAutoRefresh(boolean autoRefresh)

Sets the autoRefresh property. If autoRefresh is enabled, the data object will refresh its value (perform the service call on the data source) whenever it receives a property change event on any of its service arguments.

Parameters:
autoRefresh - true to enable autoRefresh, false otherwise.


Package  Use  Tree  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD