jp.gr.javacons.jim
インタフェース DataProvider

既知の実装クラスの一覧:
AbstractDataProvider

public interface DataProvider

DataProvider Bean is the Bean that models the monitored device and provides other objects with the data obtained from the monitored device through a communication mechanism.

At design-time, the DataProvider object provides the necessary methods for editing the DataHolder objects it holds. These may be used by a DataReferencerEditor opened from a JIM GUI Bean, or by a Customizer from a DataProvider Bean.

At run-time, upon an update request from a cyclic thread, the monitored device, or GUI, the DataProvider object obtains and updates the value, its time stamp and quality flag information from the monitored device for each of the DataHolder objects.

The JIM framework provides the DataProvider interface necessary for the above-mentioned functions and also provides an AbstractDataProvider class with a skeleton implementation of the DataProvider interface. An arbitrary DataProvider Bean, modeled after the arbitrary monitored device, can be implemented with a minimum amount of work by extending the AbstractDataProvider class in a subclass.


メソッドの概要
 boolean addDataHolder(DataHolder dh)
          This method adds the DataHolder object provided as an argument, and invokes the notifyDataHolderAvailable method of the Manager object.
 void addedAsDataProvider()
          This method is invoked when registration with the Manager object is performed.
 void asyncRead(DataHolder dh)
          This method reads information, as specified by the DataHolder object provided as an argument, from the target device being monitored.
 void asyncRead(DataHolder[] dhs)
          This method reads information, as specified by the DataHolder objects provided as an argument, from the target device being monitored.
 void asyncWrite(DataHolder dh)
          This method writes the data value of the DataHolder object to the monitored device.
 void asyncWrite(DataHolder[] dhs)
          This method writes the data value of the DataHolder objects to the monitored device.
 boolean canAddDataHolderByUser()
          The return value indicates whether DataHolder objects may be added by the application developer at design-time, using any of the various editors.
 boolean canSetDataHolderName(DataHolder dh, String name)
          The return value indicates whether or not the character string of the second argument can be used to set the dataHolderName of the DataHolder object in the first argument.
 DataHolder getDataHolder(String dhName)
          The DataHolder object named dhName is returned.
 DataHolder[] getDataHolders()
          An array of the DataHolder objects held is returned.
 String getDataHolderTypeString(Class dataHolderClass, Class valueClass)
          Returns a character string that indicates the DataHolder type described by a combination of the arguments, dataHolderClass and valueClass.
 Component getDataParameterEditor(DataHolder dh)
          The DataHolder parameter configuration editor is returned for the DataHolder object argument supplied.
 String getDataProviderName()
          The dataProviderName is returned.
 Class[][] getProvidableDataHolderTypeInfo()
          Information on the DataHolder types that can be handled are returned.
 void removedAsDataProvider()
          This method is invoked when deregistration from the Manager object is performed.
 boolean removeDataHolder(DataHolder dh)
          This method removes the DataHolder object provided as an argument, and invokes the notifyDataHolderRevoked method of the Manager object.
 void setDataProviderName(String name)
          The dataProviderName is set, and the notifyDataProviderRenamed method of the Manager object is invoked.
 void syncRead(DataHolder dh)
          This method read information, as specified by the DataHolder object provided as an argument, from the target device being monitored.
 void syncRead(DataHolder[] dhs)
          This method reads information, as specified by the DataHolder objects provided as an argument, from the target device being monitored.
 void syncWrite(DataHolder dh)
          This method writes the data value of the DataHolder object to the monitored device.
 void syncWrite(DataHolder[] dhs)
          This method writes the data value of the DataHolder objects to the monitored device.
 

メソッドの詳細

addDataHolder

public boolean addDataHolder(DataHolder dh)
                      throws DataProviderDoesNotSupportException
This method adds the DataHolder object provided as an argument, and invokes the notifyDataHolderAvailable method of the Manager object. A boolean true is returned if a change in the members of the DataHolder object group occurs due to execution of this method.

If this method is not supported, a DataProviderDoesNotSupportException is thrown. If it is impossible to maintain the DataHolder object provided as an argument, an IllegalArgumentException is thrown.


addedAsDataProvider

public void addedAsDataProvider()
This method is invoked when registration with the Manager object is performed. It can be used to perform some action if necessary.

asyncRead

public void asyncRead(DataHolder[] dhs)
               throws DataProviderDoesNotSupportException
This method reads information, as specified by the DataHolder objects provided as an argument, from the target device being monitored. The value read, time stamp and quality flag information is then set in the DataHolder objects.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.

Execution of the process on the calling side should continue immediately after the invocation of the async method.


asyncRead

public void asyncRead(DataHolder dh)
               throws DataProviderDoesNotSupportException
This method reads information, as specified by the DataHolder object provided as an argument, from the target device being monitored. The value read, time stamp and quality flag information is then set in the DataHolder object.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.

Execution of the process on the calling side should continue immediately after the invocation of the async method.


asyncWrite

public void asyncWrite(DataHolder[] dhs)
                throws DataProviderDoesNotSupportException
This method writes the data value of the DataHolder objects to the monitored device.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.

Execution of the process on the calling side should continue immediately after the invocation of the async method.


asyncWrite

public void asyncWrite(DataHolder dh)
                throws DataProviderDoesNotSupportException
This method writes the data value of the DataHolder object to the monitored device.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.

Execution of the process on the calling side should continue immediately after the invocation of the async method.


canAddDataHolderByUser

public boolean canAddDataHolderByUser()
The return value indicates whether DataHolder objects may be added by the application developer at design-time, using any of the various editors.

canSetDataHolderName

public boolean canSetDataHolderName(DataHolder dh,
                                    String name)
The return value indicates whether or not the character string of the second argument can be used to set the dataHolderName of the DataHolder object in the first argument.

If dh is not held by the DataProvider, an IllegalArgumentException is thrown.


getDataHolder

public DataHolder getDataHolder(String dhName)
The DataHolder object named dhName is returned. Null is returned if no, such named, DataHolder object exists.

getDataHolders

public DataHolder[] getDataHolders()
An array of the DataHolder objects held is returned.

getDataHolderTypeString

public String getDataHolderTypeString(Class dataHolderClass,
                                      Class valueClass)
Returns a character string that indicates the DataHolder type described by a combination of the arguments, dataHolderClass and valueClass. If the character string is not specified, null is returned.

getDataParameterEditor

public Component getDataParameterEditor(DataHolder dh)
The DataHolder parameter configuration editor is returned for the DataHolder object argument supplied. This editor must have the DataParameterEditor interface implemented. If no editor has been provided, null is returned.

getDataProviderName

public String getDataProviderName()
The dataProviderName is returned.

getProvidableDataHolderTypeInfo

public Class[][] getProvidableDataHolderTypeInfo()
Information on the DataHolder types that can be handled are returned. The return value is an array (Class[][]) of which each element is also an array where the first element is the Class object which represents the class of the DataHolder object. The second and subsequent elements are the Class objects for the value classes of the DataHolder object. The above Class objects should not include abstract classes. Even if the Class object of the value class is defined as fixed by the getValueClass method of a DataHolder subclass, a Class object should be specified in the second element.

removedAsDataProvider

public void removedAsDataProvider()
This method is invoked when deregistration from the Manager object is performed. It can be used to perform some action if necessary.

removeDataHolder

public boolean removeDataHolder(DataHolder dh)
                         throws DataProviderDoesNotSupportException
This method removes the DataHolder object provided as an argument, and invokes the notifyDataHolderRevoked method of the Manager object. A boolean true is returned if a change in the members of the DataHolder object group occurs due to execution of this method.

If this method is not supported, a DataProviderDoesNotSupportException is thrown.


setDataProviderName

public void setDataProviderName(String name)
The dataProviderName is set, and the notifyDataProviderRenamed method of the Manager object is invoked.

If the name of the argument is not valid as a dataProviderName, an IllegalArgumentException is thrown.


syncRead

public void syncRead(DataHolder[] dhs)
              throws DataProviderDoesNotSupportException
This method reads information, as specified by the DataHolder objects provided as an argument, from the target device being monitored. The value read, time stamp and quality flag information is then set in the DataHolder objects.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.


syncRead

public void syncRead(DataHolder dh)
              throws DataProviderDoesNotSupportException
This method read information, as specified by the DataHolder object provided as an argument, from the target device being monitored. The value read, time stamp and quality flag information is then set in the DataHolder object.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.


syncWrite

public void syncWrite(DataHolder[] dhs)
               throws DataProviderDoesNotSupportException
This method writes the data value of the DataHolder objects to the monitored device.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.


syncWrite

public void syncWrite(DataHolder dh)
               throws DataProviderDoesNotSupportException
This method writes the data value of the DataHolder object to the monitored device.

Even if this method has not been fully implemented, it should at least be implemented, in so much as to throw a DataProviderDoesNotSupportException.