ServantBase.java 1.77 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.slf4j.Logger
 *  org.slf4j.LoggerFactory
 */
package com.adobe.CORBA;

import com.adobe.CORBA.impl.ServantBasePeer;
import org.omg.CORBA.Object;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.naming.NameNotFoundException;
import java.rmi.RemoteException;

public class ServantBase {
    private Logger logger = LoggerFactory.getLogger(ServantBase.class);
    Object corbaObj;
    private final ServantBasePeer peer;

    public ServantBase() {
        this.peer = ServantBasePeer.getFactory().create(this);
    }

    public ServantBase(java.lang.Object operations) {
        this.peer = ServantBasePeer.getFactory().create(operations);
    }

    public Object activate() {
        this.corbaObj = this.peer.activate(null);
        this.logger.debug("Servant activated peer {} without owner, returning CORBA object {}", (java.lang.Object)this.peer, (java.lang.Object)this.corbaObj);
        return this.corbaObj;
    }

    public Object activateWithOwner(java.lang.Object owner) {
        this.corbaObj = this.peer.activate(owner);
        this.logger.debug("Servant activated peer {} with owner {}, returning CORBA object {}", new java.lang.Object[]{this.peer, owner, this.corbaObj});
        return this.corbaObj;
    }

    public static void deactivateForOwner(java.lang.Object owner) {
        ServantBasePeer.getFactory().deactivateForOwner(owner);
    }

    public void deactivate() {
        this.peer.deactivate();
        this.corbaObj = null;
    }

    public Object _this() {
        return this.corbaObj;
    }

    public Object _newServiceConnection(String serviceName) throws RemoteException, NameNotFoundException {
        return this.peer.newServiceConnection(serviceName);
    }
}