Oracle Portal-to-Go Implementation Guide Release 1.0.2.2 A86635-02 |
|
This document discusses the components you can use to extend Portal-to-Go functionality. Topics include:
Portal-to-Go supports system-wide extensibility. Not only can you create adapters and transformers that extend its core functionality, you can modify the internal processing of its core objects and create specialized components for system monitoring and integration.
Portal-to-Go uses the System.properties file to determine at runtime which components to use for system processes. When you create a class to implement specialized functionality, you plug the class into the Portal-to-Go architecture by identifying the class as a key value in the System.properties file.
Portal-to-Go supports the following types of plug-in classes:
To customize or implement a new component in the Portal-to-Go architecture:
You must implement the pluggable class as a singleton (only a single instance of the class can exist in the system at a time), with static class methods. You should include the class in the system CLASSPATH, so that it can be loaded by the standard Java Virtual Machine class loader. When changing a component, you must shut down and restart the Portal-to-Go server processes.
You create your own Portal-to-Go system daemons by implementing the following interfaces:
You use the notification listener interface to implement your own Portal-to-Go notification engine. The notification engine responds to incoming messages. Currently, the default implementation of the notification engine handles email (SMTP) and Short Message Service (SMS) messages.
You can use only one notification engine in a Portal-to-Go system.
You specify domain-specific runtime parameters for the notification engine in the Notification.properties file. This file contains settings for the SMS listener port and the server name.
You implement the log listeners interface to create classes that respond to log events.
You can create any number of log listeners in Portal-to-Go.
Portal-to-Go provides the following types of hooks:
In some cases, you may want to alter the internal processing for the Portal-to-Go objects. You can accomplish this using programmatic hooks provided by Portal-to-Go.
While you can extend internal object processing, you cannot alter the fundamental object model. The following sections provide a sample implementation that extends the master service. For more information regarding the hooks in object functionality, see the Portal-to-Go API specification.
You must be able to construct each persistent object with either a known object identifier or an empty constructor, as follows:
public class MyMasterService extends MasterService { public MyMasterService() { super(); } public MyMasterService(Long id) { super(id); } // override some logic. public void invoke(ServiceRequest request) throws Exception { super.invoke(request); sendMessageToOnlinePaymentSystem(request); } }
Each persistent object has two methods that the persistent locator must implement. The persistent locator must also implement the singleton pattern, as follows:
MasterService lookupMasterService(Long id); MasterService newMasterService(); public class MyPersistentLocator extends PersistentLocatorImpl { private static PersistentLocator instance = null; // Always calls to the empty constructor of the superclass protected MyPersistentLocator() { super(); } // The thread-safe singleton getter public static PersistentLocator getInstance() { if (instance == null) { MyPersistentLocator impl = null; synchronized (MyPersistentLocator.class) { if (instance == null) { impl = new MyPersistentLocator(); instance = impl; } } // do the initialization here needed for some components, // to avoid recursive loops // watch out for initialize() methods if (impl != null) { impl.initialize(); } } return instance; } // Override newMasterService public MasterService newMsterService() { return new MyMasterServiceImpl(); } // Override lookupMasterService public MasterService lookupMasterService(Long id) { MasterService m = (MasterService)getMasterSet().get(id); // always // check the cache first if (m == null) { // no hit m = new MyMasterServiceImpl(id); // activate an existing // object from storage } return m; } }
Reference the new locator in the System.properties file:
locator.persistent.class=MyPersistentLocator
|
Copyright © 2000 Oracle Corporation. All Rights Reserved. |
|