Package org.omg.PortableServer

Examples of org.omg.PortableServer.POA


    * service requests to the servant, if appropriate.
    */
    public void run()
    {
        // Establish our POA
        POA oPOA = null;

        try
        {
            oPOA =
                POAHelper.narrow(moORB.resolve_initial_references("RootPOA"));
            oPOA.the_POAManager().activate();
        }
        catch (Exception oEx)
        {
            soLog.error("Error establishing POA.", oEx);
        }
View Full Code Here


                //System.err.println("  tnameserv -ORBInitialPort 5080");
                return;
            }

            Object rootPoaRef = orb.resolve_initial_references("RootPOA");
            POA rootPoa = POAHelper.narrow(rootPoaRef);
            rootPoa.the_POAManager().activate();

            SMSGatewayServant smsGateway = new SMSGatewayServant();
            Object smsGatewayRef = rootPoa.servant_to_reference(smsGateway);

            String corbaServerName = "SMSGatewayCORBAService";
            NameComponent[] name = {new NameComponent(corbaServerName, "")};
            namingCtx.rebind(name, smsGatewayRef);
View Full Code Here

     * @exception TransientServiceException
     */
    public void initialize(ORB orb) throws TransientServiceException {
        try {
            // get the root POA.  We're going to re
            POA rootPOA = (POA)orb.resolve_initial_references("RootPOA");
            rootPOA.the_POAManager().activate();

            // we need to create a POA to manage this named instance, and then activate
            // a context on it.
            Policy[] policy = new Policy[3];
            policy[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT);
            policy[1] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID);
            policy[2] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);

            POA nameServicePOA = rootPOA.create_POA("TNameService", null, policy);
            nameServicePOA.the_POAManager().activate();

            // create our initial context, and register that with the ORB as the name service
            initialContext = new TransientNamingContext(orb, nameServicePOA);
            org.omg.CORBA.Object context = initialContext.getRootContext();
            Method method =
View Full Code Here

     * @exception TransientServiceException
     */
    public void initialize(ORB orb) throws TransientServiceException {
        try {
            // get the root POA.  We're going to re
            POA rootPOA = (POA)orb.resolve_initial_references("RootPOA");
            rootPOA.the_POAManager().activate();

            // we need to create a POA to manage this named instance, and then activate
            // a context on it.
            Policy[] policy = new Policy[3];
            policy[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT);
            policy[1] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID);
            policy[2] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);

            POA nameServicePOA = rootPOA.create_POA("TNameService", null, policy);
            nameServicePOA.the_POAManager().activate();

            // create our initial context, and register that with the ORB as the name service
            initialContext = new TransientNamingContext(orb, nameServicePOA);
            org.omg.CORBA.Object context = initialContext.getRootContext();
            Method method =
View Full Code Here

            location = address.getLocation();
        }

        org.omg.CORBA.Object obj = null;
        try {
            POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
            POAManager poaManager = rootPOA.the_POAManager();

            Policy[] policies = new Policy[3];
            policies[0] = rootPOA
                    .create_lifespan_policy(
                        org.omg.PortableServer.LifespanPolicyValue.PERSISTENT);
            policies[1] = rootPOA
                    .create_implicit_activation_policy(
                        org.omg.PortableServer.ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION);
            policies[2] = rootPOA
                    .create_id_uniqueness_policy(
                        org.omg.PortableServer.IdUniquenessPolicyValue.UNIQUE_ID);

            POA bindingPOA = rootPOA.create_POA("BindingPOA", poaManager, policies);
            CorbaDSIServant servant = new CorbaDSIServant(orb, bindingPOA, this, sbeCallback);
            byte[] objectId = bindingPOA.activate_object(servant);
            obj = bindingPOA.id_to_reference(objectId);
           
            if (location.startsWith("relfile:")) {
                String iorFile = location.substring("relfile:".length(), location.length());
                // allow for up to 3 '/' to match common uses of relfile url format
                for (int n = 0; n < 3; n++) {
View Full Code Here

  return _orb();
    }

    public void orb(org.omg.CORBA.ORB orb) {
        try {
            POA _poa = POAHelper.narrow(orb
                    .resolve_initial_references("RootPOA"));

            _poa.activate_object(this);
        } catch (org.omg.CORBA.ORBPackage.InvalidName ex) {
            throw new RuntimeException("ORB must have POA support");
        } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) {
            throw new RuntimeException("wrong policy: " + ex);
        } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) {
View Full Code Here

import org.apache.yoko.orb.OB.BootManagerPackage.AlreadyExists;

public class Server {
    static int run(ORB orb, String[] args) throws UserException {
        // Resolve Root POA
        POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));

        // Get a reference to the POA manager
        POAManager manager = rootPOA.the_POAManager();

        // Create implementation object
        HelloWorldImpl hwImpl = new HelloWorldImpl(rootPOA);
        HelloWorld hello = hwImpl._this(orb);
View Full Code Here

    @Override
    public void start(StartContext context) throws StartException {
        JacORBLogger.ROOT_LOGGER.debugServiceStartup(context.getController().getName().getCanonicalName());

        ORB orb = this.orbInjector.getOptionalValue();
        POA parentPOA = this.parentPOAInjector.getOptionalValue();

        // if an ORB has been injected, we will use the ORB.resolve_initial_references method to instantiate the POA.
        if (orb != null) {
            try {
                this.poa = POAHelper.narrow(orb.resolve_initial_references(this.poaName));
            } catch (Exception e) {
                throw JacORBLogger.ROOT_LOGGER.errorResolvingInitRef(this.poaName, e);
            }
        }
        // if a parent POA has been injected, we use it to create the policies and then the POA itself.
        else if (parentPOA != null) {
            try {
                Policy[] poaPolicies = this.createPolicies(parentPOA);
                this.poa = parentPOA.create_POA(this.poaName, null, poaPolicies);
            } catch (Exception e) {
                throw JacORBLogger.ROOT_LOGGER.errorCreatingPOAFromParent(e);
            }
        } else {
            throw JacORBLogger.ROOT_LOGGER.invalidPOACreationArgs();
View Full Code Here

    @Override
    public void start(StartContext context) throws StartException {
        JacORBLogger.ROOT_LOGGER.debugServiceStartup(context.getController().getName().getCanonicalName());

        ORB orb = orbInjector.getValue();
        POA rootPOA = rootPOAInjector.getValue();
        POA namingPOA = namingPOAInjector.getValue();

        try {
            // initialize the static naming service variables.
            CorbaNamingContext.init(orb, rootPOA);

            // create and initialize the root context instance according to the configuration.
            CorbaNamingContext ns = new CorbaNamingContext();
            Configuration configuration = ((org.jacorb.orb.ORB) orb).getConfiguration();
            boolean doPurge = configuration.getAttribute("jacorb.naming.purge", "off").equals("on");
            boolean noPing = configuration.getAttribute("jacorb.naming.noping", "off").equals("on");
            ns.init(namingPOA, doPurge, noPing);

            // create and activate the root context.
            byte[] rootContextId = "root".getBytes();
            namingPOA.activate_object_with_id(rootContextId, ns);
            namingService = NamingContextExtHelper.narrow(namingPOA.create_reference_with_id(rootContextId,
                    "IDL:omg.org/CosNaming/NamingContextExt:1.0"));
        } catch (Exception e) {
            throw JacORBLogger.ROOT_LOGGER.failedToStartJBossCOSNaming(e);
        }
View Full Code Here

    /**
     * Unexport this object.
     */
    public void shutdown() {
        POA poa = getPOA();
        try {
            poa.deactivate_object(poa.reference_to_id(getReference()));
        } catch (UserException ex) {
            JacORBLogger.ROOT_LOGGER.warnCouldNotDeactivateIRObject(ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.omg.PortableServer.POA

Copyright © 2018 www.massapicom. 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.