package RemoveEventsWithAnchoredObjects;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import Framework.EventManager;
import Framework.RemoteEvent;
import Framework.RemoteProxy;
import Framework.RuntimeProperties;
import Framework.ServiceObjectContext;
import Framework.UsageException;
import Framework.anchored.Anchorable;
import Framework.anchored.AnchoredProxy;
import Framework.anchored.MethodMapper;
import Framework.anchored.ServiceInvoker;
import Framework.anchored.ServiceProxy;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.lang.String;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Hashtable;
/**
* Notify<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=true, isAnchored=true, isShared=false, isTransactional=false)
@SuppressWarnings("serial")
public class Notify
implements Serializable, Observable, Anchorable
{
// ---------
// Constants
// ---------
// -----------------
// Event definitions
// -----------------
public static final String cEVENT_STATUS_CHANGE = "StatusChange";
// ----------
// Attributes
// ----------
public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
/**
* The flag to use for "isAnchored" and the listener for remote requests
*/
protected ServiceInvoker invoker = null;
// ------------
// Constructors
// ------------
public Notify() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
this.setIsAnchored(true);
}
/**
* A dummy constructor used to instantiate a "blank" object. This is used for anchored objects, Spring beans and their
* superclasses, but should not be expected to create a valid Notify.
*/
public Notify(ServiceObjectContext pContext) {
}
// ----------------------
// Accessors and Mutators
// ----------------------
public boolean getIsAnchored() {
return invoker != null;
}
public void setIsAnchored(boolean isAnchored) {
if (isAnchored && invoker == null) {
// Anchor the object, creating an invoker for it.
this.invoker = new ServiceInvoker(this);
}
else if (!isAnchored && invoker != null) {
this.invoker = null;
}
}
/**
* Get the invoker for this class. This method should only be called from the proxy, hence the protected level visibility.
*/
protected ServiceInvoker getInvoker(Notify pService) {
return pService.invoker;
}
// -------
// Methods
// -------
public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
qq_Listeners.addPropertyChangeListener(property, listener);
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
qq_Listeners.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
qq_Listeners.removePropertyChangeListener(property, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
qq_Listeners.removePropertyChangeListener(listener);
}
/**
* Get the proxy class which will forwards remote requests to this class. This
* must be kept as a method so it can be overridden in all subclasses, ensuring
* a proxy to the lowest level subclass is returned.
*/
public AnchoredProxy getProxy() {
return new NotifyProxy(this);
}
/**
* Override the writeReplace method to replace this class with a proxy to it (if it's anchored)
*/
public Object writeReplace() throws ObjectStreamException {
if (getIsAnchored()) {
this.invoker.prepareForRemoteCall();
AnchoredProxy proxy = this.getProxy();
//System.out.println("Replacing " + this + " with " + proxy + " in writeReplace");
return proxy;
}
else {
return this;
}
}
/**
* Satisfy the {@link RemoteEventProxy} interface
*/
public String registerInterest(String pHostName, RemoteEvent pAnchoredObject, String pEvent) {
return EventManager.registerInterest(pHostName, pAnchoredObject, this, pEvent);
}
public void postEvent(String pEventName, Hashtable<String, Object> pParameters) {
EventManager.postEvent(this, pEventName, pParameters);
}
public void deregisterInterest(String pHostName, RemoteEvent pAnchoredObject, String pEvent) {
EventManager.deregisterInterest(pHostName, pAnchoredObject, this, pEvent);
}
} // end class Notify
// c Pass 2 Conversion Time: 16 milliseconds