Java Code Examples for com.sun.corba.se.internal.iiop.ORB

Following code examples demonstrate how to use com.sun.corba.se.internal.iiop.ORBfrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.sun.corba.se.internal.iiop.ORBand various code implementation of this class.

    
    public static final void main(String[] args)
    {
	String propertiesFilename = null;

	Properties props = new Properties() ;
	props.put( "org.omg.CORBA.ORBClass", "com.sun.corba.se.internal.iiop.ORB" ) ;
	com.sun.corba.se.internal.iiop.ORB orb = (com.sun.corba.se.internal.iiop.ORB)
	    org.omg.CORBA.ORB.init(args,props);

	try {
	    String ips = System.getProperty("org.omg.CORBA.ORBInitialPort");
	    if (ips != null && ips.length() > 0)
		initialPort = java.lang.Integer.parseInt(ips);
	} catch (java.lang.NumberFormatException e) {
	}
	for (int i=0;i<args.length;i++) {
	    if (args[i].equals("-InitialServicesFile") && i < args.length -1) {
		propertiesFilename = args[i+1];
	    }
	    if (args[i].equals("-ORBInitialPort") && i < args.length-1) {
		initialPort = java.lang.Integer.parseInt(args[i+1]);
	    }
	}

	if (propertiesFilename == null) {
	    System.out.println(CorbaResourceUtil.getText("bootstrap.usage", "BootstrapServer"));
	    return;
	}

	File file = new File(propertiesFilename);

	if (file.exists() == true && file.canRead() == false) {
	    System.err.println(CorbaResourceUtil.getText("bootstrap.filenotreadable", file.getAbsolutePath()));
	    return;
	}

	System.out.println(CorbaResourceUtil.getText("bootstrap.success", Integer.toString(initialPort), file.getAbsolutePath()));

	BootstrapServer server = new BootstrapServer(orb,
						     initialPort,
						     file,
						     new Properties());

	server.start();

	java.lang.Object sync = new java.lang.Object();
	try {
	    synchronized (sync) { sync.wait();}
	} catch (Exception ex) {}

    }

    public final static boolean debug = false;
    private int listenerPort;
    private Thread listenerThread;
    private BootstrapServiceProperties supportedServices;
    private BootstrapRequestHandler serverSC;
    private com.sun.corba.se.internal.iiop.ORB orb;
} 


    }

    LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc,
            boolean user)
    {
        this(request,
            MessageBase.createReply(
                            (com.sun.corba.se.internal.iiop.ORB) request.orb(),
                            request.getGIOPVersion(), request.getRequestId(),
                            user ? ReplyMessage.USER_EXCEPTION :
                                   ReplyMessage.SYSTEM_EXCEPTION,
                            svc, null),
            null);
    } 

    }

    public ClientResponse getClientResponse()
    {
        getMessage().setSize(getByteBuffer(), getSize());

        LocalClientResponseImpl result =
            new LocalClientResponseImpl(
                (com.sun.corba.se.internal.iiop.ORB) orb(),
                toByteArray(), reply);


        

        return result ;
    } 

    
    public ClientResponse invoke() 
    {	
	com.sun.corba.se.internal.iiop.ORB myORB = (com.sun.corba.se.internal.iiop.ORB)orb() ;

	ServerResponse serverResponse = myORB.process( getServerRequest() ) ;

	LocalServerResponseImpl lsr = (LocalServerResponseImpl)serverResponse ;

	return lsr.getClientResponse() ;
    } 

Advertisement
Javadoc
Deprecated class for backward compatibility.
Advertisement