All Examples  This Package

Class examples.workspace.monitor.MirrorMonitor

java.lang.Object
   |
   +----examples.workspace.monitor.MirrorMonitor

public class MirrorMonitor
extends Object
implements SetMonitor, DestroyMonitor
This code example shows how a Workspace Monitor can be used to mirror a workspace value in another workspace. In this class, we implement both the SetMonitor and the DestroyMonitor interfaces, since we want to mirror both updates (sets) and deletes (destroys) of the mirrored Workspace values.

To set up this example:

  1. Set up your development shell as described in Setting up your environment.

  2. Compile this example by executing the following command in your development shell:

    $ javac -d %SERVER_CLASSES% MirrorMonitor.java

  3. You do not execute this example directly; it is called by the MonitorDemo class. You must compile all the other examples in this package before running MonitorDemo.

Author:
Copyright (c) 1997-2000 by BEA Systems, Inc. All Rights Reserved.

Variable Index

 o services

Constructor Index

 o MirrorMonitor()

Method Index

 o monitorInit(ParamSet, boolean)
Initializes a monitor.
 o postDestroy(Destroyable, ParamSet, Exception)
Implement this method to carry out some arbitrary operations after the target object is destroyed.
 o postSet(Setable, ParamSet, Exception)
Implement this method to carry out some arbitrary operations after the target object's set() method is called.
 o preDestroy(Destroyable, ParamSet)
Implement this method to carry out some arbitrary operations before the target object is destroyed.
 o preSet(Setable, ParamSet)
Implement this method to carry out some arbitrary operations before the target object's set() method is called.
 o setServices(T3ServicesDef)
Sets the services stub for this class.

Variables

 o services
 public T3ServicesDef services

Constructors

 o MirrorMonitor
 public MirrorMonitor()

Methods

 o monitorInit
 public void monitorInit(ParamSet params,
                         boolean isMaster) throws ParamSetException
Initializes a monitor. This allows passing of initialization parameters even when the object is instantiated remotely on the WebLogic Server with a default constructor (which cannot have arguments).

Parameters:
params - ParamSet of initialization values
isMaster - true if this is a Master Monitor
Throws: ParamSetException
if the Monitor cannot be initialized or there is a problem with the ParamSet
 o setServices
 public void setServices(T3ServicesDef services)
Sets the services stub for this class. It allows you to write a class that can be instantiated by a client or a WebLogic Server -- how this class accesses WebLogic services is determined by the services stub, which is set at runtime.

 o preSet
 public void preSet(Setable target,
                    ParamSet callbackData) throws MonitorException
Implement this method to carry out some arbitrary operations before the target object's set() method is called. The target object must implement the weblogic.common.Setable interface.

Parameters:
target - Object to be set
callbackData - ParamSet of potential data for callback
Throws: MonitorException
if a Monitor vetoes the operation
 o postSet
 public void postSet(Setable target,
                     ParamSet callbackData,
                     Exception e)
Implement this method to carry out some arbitrary operations after the target object's set() method is called. The target object must implement the weblogic.common.Setable interface.

Parameters:
target - Object to be set
callbackData - ParamSet of potential data for callback
e - Exception to be thrown if the monitor is vetoed or does not complete
 o preDestroy
 public void preDestroy(Destroyable target,
                        ParamSet callbackData)
Implement this method to carry out some arbitrary operations before the target object is destroyed. The target object must implement the weblogic.common.Destroyable interface.

Parameters:
target - Object to be destroyed
callbackData - ParamSet of potential data for callback
 o postDestroy
 public void postDestroy(Destroyable target,
                         ParamSet callbackData,
                         Exception e)
Implement this method to carry out some arbitrary operations after the target object is destroyed. Here we remove the mirrored value.

Parameters:
target - Object to be mirrored
callbackData - ParamSet of potential data for callback
e - Exception to be thrown if the monitor is vetoed or does not complete

All Examples  This Package