SingletonConnectionFactory.java 1.86 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.service;

import com.adobe.CORBA.ServantBase;
import com.adobe.service.ConnectionFactory;
import com.adobe.service.impl.Platform;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Object;
import org.omg.CORBA.portable.ObjectImpl;

import java.io.Serializable;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.Map;

/*
 * This class specifies class file version 49.0 but uses Java 6 signatures.  Assumed Java 6.
 */
class SingletonConnectionFactory
implements ConnectionFactory,
Serializable {
    private java.lang.Object singleton = null;
    private java.lang.Object theServant = null;

    public SingletonConnectionFactory(java.lang.Object obj) {
        this.singleton = obj;
    }

    @Override
    public java.lang.Object getConnection() {
        if (this.theServant == null) {
            try {
                ServantBase sb = (ServantBase)this.singleton;
                ORB orb = Platform.UTIL.getOrb();
                sb.activate();
                this.theServant = sb._this();
                if (this.theServant instanceof ObjectImpl) {
                    ObjectImpl objectImpl = (ObjectImpl)this.theServant;
                    String ior = orb.object_to_string(objectImpl);
                    this.theServant = orb.string_to_object(ior);
                }
            }
            catch (Throwable t) {
                throw new UndeclaredThrowableException(t);
            }
        }
        return this.theServant;
    }

    @Override
    public void setImpersonationIdentities(Map<String, String> credentialMap) {
    }

    @Override
    public void clearImpersonationIdentities() {
    }

    @Override
    public void resetProcesses() {
    }

    @Override
    public void setServiceTimeout(long seconds) {
    }

    @Override
    public void setCurrentInstanceTimeout(long seconds) {
    }
}