In the preceding section, we gave an example of how to place data in the framework’s storage so that the data would be returned to the client as the results of a command. The storeService field in each command manager can store data for additional purposes. There are six defined DefaultScopeTypes:
This is used by the framework as it is initializing. It should never be used by command handler methods.
This is used by the framework as it is initializing. It should never be used by command handler methods.
Using this scope type will cause the data to be stored for the life of the servlet. This should be very, very rarely used by command listeners.
Using this scope type will cause the data to be stored until the current client/server session is no longer valid. At that point, the framework will remove all data stored in this scope. Store information in this scope that needs to be recovered when processing subsequent commands.
Using this scope makes the data available to any client connected using the same EAS user id. When all sessions associated with this user are no longer valid, the framework will remove data stored in this scope. In the current implementation, this is never used and it probably will never be used very often.
Using this scope makes the data available until the framework has bundled the results of the command and returned them to the client. The framework then removes all data stored in this scope associated with the request that just finished.
Storing data is done through a command listener’s store service, as in the preceding example. The StoreService interface has several get(), set(), and remove() methods. However, there is only one of each of these methods that a command listener (or other plug-in code) should call; the other methods were put in place for use by some of the framework code itself. The three method signatures are:
public Object get(ServiceContext context, ScopeType type, Object key); public Object set(ServiceContext context, ScopeType type, Object key, Object value); public Object remove(ServiceContext context, ScopeType type, Object key);
For more information about these methods, see the Essbase Administration Services Java API Reference.