CountPOAServerWithActivator

CountPOAServerWithActivator - / /...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// CountPOAServerWithActivator.java: The Count Server main program / import org.omg.PortableServer.*; import org.omg.CosNaming.*; import java.io.*; i class CountPOAServerWithActivator { static public void main(String[] args) { try { // Initialize the ORB org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); // get a reference to the root POA POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); // Create policies for our persistent POA org.omg.CORBA.Policy[] policies = { rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT), rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID), rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN), rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_SERVANT_M ANAGER) }; // Create myPOA with the right policies final POA myPOA = rootPOA.create_POA( "count_poa", rootPOA.the_POAManager(), policies ); p // Decide on the ID for the servant final byte[] countId = "Count".getBytes();
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

CountPOAServerWithActivator - / /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online