ExtendedClassRegistry
acts as a registration mechanism for client programs to designate their own
implementation classesthat extend AR System Java API classes (i.e. classes in com.bmc.arsys.api package, for
example ActiveLink, AttachmentInfo, AssignFilterApiInfo and so on).
Such registration would allow AR System API implementation to instantiate the user prefered extended type objects as
needed, instead of its own raw types. For example, if a client extends ActiveLink class (say as ActiveLinkEx) and
registers it with Java API using
ExtendedClassRegistry
; then the Java API would instantiate an
ActiveLinkEx object (instead of the typical ActiveLink) during ActiveLinkFactory.find(),
ActiveLinkFactory.findObjects() etc.
In order for a user prefered extended type suitable for registering, it must meet the requirements listed below:
- extends a specific Java API class or its descendent
- Optionally implements
ExtendedClassCallbackHandler
- has an no-arguments (defaut) constructor
Following Java code snippet shows an example usage:
//Instantiate a registry... ExtendedClassRegistry registry = new ExtendedClassRegistry(); //... register extended
types... registry.registerExtendedClass(ActiveLink.class, ActiveLinkEx.class); // ActiveLinkEx above is your own
class that extends ActiveLink. registry.registerExtendedClass(WorkflowConnectInfo.class,
WorkflowConnectInfoEx.class); registry.registerExtendedClass(Attachment.class, AttachmentEx.class);
registry.registerExtendedClass(ActiveLinkActionInfo.class, ActiveLinkActionInfoEx.class); // Above xxxEx classes
extend corresponding xxx Java API class // These extending classes optionally can implement
ExtendedClassCallbackHandler
interface. //... attach this registry to your ARServerUser object...
ARServerUser su = new ARServerUser("", "", "", ""); su.setExtendedClassRegistry(ecr); //
... now issue AR System API calls as usual ... ActiveLinkCriteria criteria = new ActiveLinkCriteria();
criteria.setRetrieveAll(true); // Here, observe that we're receiving an ActiveLinkEx from Java API ActiveLinkEx
actLink = ActiveLinkFactory.findByKey(su, "", criteria); WorkflowObjectListCriteria listCriteria = new
WorkflowObjectListCriteria (); // Here, observe that we're receiving an ActiveLinkEx[] from Java API ActiveLinkEx[]
actLinks = ActiveLinkFactory.findObjects(su, listCriteria, criteria);