Package Distributed2

Source Code of Distributed2.TopCustomizedDBMgr

package Distributed2;

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.io.ObjectStreamException;
import java.io.Serializable;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Hashtable;

/**
* TopCustomizedDBMgr<p>
* <p>
* @author Generated from Forte
* @since  19-Nov-2008
*/
@RuntimeProperties(isDistributed=true, isAnchored=true, isShared=false, isTransactional=false)
@SuppressWarnings("serial")
public class TopCustomizedDBMgr
        implements Serializable, Anchorable
{

    // ----------
    // Attributes
    // ----------
    private TopCustomizedDBMgr dBMgr;
    private TopCustomizedDBMgr parentService;
    /**
     * The flag to use for "isAnchored" and the listener for remote requests
     */
    protected ServiceInvoker invoker = null;

    // ------------
    // Constructors
    // ------------
    public TopCustomizedDBMgr() {
        // 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 TopCustomizedDBMgr.
     */
    public TopCustomizedDBMgr(ServiceObjectContext pContext) {
    }

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public void setDBMgr(TopCustomizedDBMgr dBMgr) {
        this.dBMgr = dBMgr;
    }

    public TopCustomizedDBMgr getDBMgr() {
        return this.dBMgr;
    }

    public void setParentService(TopCustomizedDBMgr parentService) {
        this.parentService = parentService;
    }

    public TopCustomizedDBMgr getParentService() {
        return this.parentService;
    }

    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(TopCustomizedDBMgr pService) {
        return pService.invoker;
    }

    // -------
    // Methods
    // -------
    /**
     * setup<p>
     * <p>
     */
    public void setup() {
    }

    /**
     * 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 TopCustomizedDBMgrProxy(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 TopCustomizedDBMgr
// c Pass 2 Conversion Time: 46 milliseconds
TOP

Related Classes of Distributed2.TopCustomizedDBMgr

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.