Java Code Examples for org.omg.CORBA.Request

The following are top voted examples for showing how to use org.omg.CORBA.Request. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 2
Project: openjdk-jdk10   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(null, invokeObject, "ORB-Request-Thread", 0, false).start();
    }
}
 
Example 3
Project: openjdk9   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(null, invokeObject, "ORB-Request-Thread", 0, false).start();
    }
}
 
Example 4
Project: lookaside_java-1.8.0-openjdk   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 5
Project: jdk8u_corba   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 6
Project: javify   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Test catching the user exception, thrown on the remote side.
 */
public void testUserException()
{
  System.out.println("**** Test user exception:");

  ExceptionList exList = orb.create_exception_list();
  exList.add(WeThrowThisExceptionHelper.type());

  Request rq =
    object._create_request(null, "throwException", orb.create_list(1), null,
                           exList, null
                          );

  rq.add_in_arg().insert_long(123);
  rq.invoke();

  UnknownUserException uku = (UnknownUserException) rq.env().exception();
  WeThrowThisException our_exception = WeThrowThisExceptionHelper.extract(uku.except);

  System.out.println("  Our user exception, field " + our_exception.ourField +
                     ", has been thrown on remote side."
                    );
}
 
Example 7
Project: javify   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Passes wide (UTF-16) string and narrow (ISO8859_1) string.
 * @see gnu.CORBA.GIOP.CharSets_OSF for supported and default
 * encodings.
 */
public void testWideNarrowStrings()
                           throws BAD_OPERATION
{
  System.out.println("**** Test 8 bit and 16 bit char strings");

  Request rq =
    object._create_request(null, "passCharacters", orb.create_list(0), null);

  rq.add_in_arg().insert_wstring("wide string");
  rq.add_in_arg().insert_string("narrow string");

  rq.set_return_type(orb.get_primitive_tc(TCKind.tk_wstring));

  rq.invoke();

  System.out.println("  Returned ' " + rq.result().value().extract_wstring());
}
 
Example 8
Project: javify   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  if (returns != null)
    g.set_result(returns);
  return g;
}
 
Example 9
Project: javify   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns, ExceptionList exceptions,
                              ContextList ctx_list
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  g.set_exceptions(exceptions);
  g.set_context_list(ctx_list);
  if (returns != null)
    g.set_result(returns);
  return g;
}
 
Example 10
Project: javify   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(getIor());
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.setORB(orb);

  return request;
}
 
Example 11
Project: javify   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns,
  ExceptionList exceptions, ContextList ctx_list
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(ior);
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.set_exceptions(exceptions);
  request.set_context_list(ctx_list);
  request.setORB(orb);

  return request;
}
 
Example 12
Project: jvm-stm   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Test catching the user exception, thrown on the remote side.
 */
public void testUserException()
{
  System.out.println("**** Test user exception:");

  ExceptionList exList = orb.create_exception_list();
  exList.add(WeThrowThisExceptionHelper.type());

  Request rq =
    object._create_request(null, "throwException", orb.create_list(1), null,
                           exList, null
                          );

  rq.add_in_arg().insert_long(123);
  rq.invoke();

  UnknownUserException uku = (UnknownUserException) rq.env().exception();
  WeThrowThisException our_exception = WeThrowThisExceptionHelper.extract(uku.except);

  System.out.println("  Our user exception, field " + our_exception.ourField +
                     ", has been thrown on remote side."
                    );
}
 
Example 13
Project: jvm-stm   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Passes wide (UTF-16) string and narrow (ISO8859_1) string.
 * @see gnu.CORBA.GIOP.CharSets_OSF for supported and default
 * encodings.
 */
public void testWideNarrowStrings()
                           throws BAD_OPERATION
{
  System.out.println("**** Test 8 bit and 16 bit char strings");

  Request rq =
    object._create_request(null, "passCharacters", orb.create_list(0), null);

  rq.add_in_arg().insert_wstring("wide string");
  rq.add_in_arg().insert_string("narrow string");

  rq.set_return_type(orb.get_primitive_tc(TCKind.tk_wstring));

  rq.invoke();

  System.out.println("  Returned ' " + rq.result().value().extract_wstring());
}
 
Example 14
Project: jvm-stm   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  if (returns != null)
    g.set_result(returns);
  return g;    
}
 
Example 15
Project: jvm-stm   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns, ExceptionList exceptions,
                              ContextList ctx_list
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  g.set_exceptions(exceptions);
  g.set_context_list(ctx_list);
  if (returns != null)
    g.set_result(returns);
  return g;
}
 
Example 16
Project: jvm-stm   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(getIor());
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.setORB(orb);

  return request;
}
 
Example 17
Project: jvm-stm   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns,
  ExceptionList exceptions, ContextList ctx_list
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(ior);
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.set_exceptions(exceptions);
  request.set_context_list(ctx_list);
  request.setORB(orb);

  return request;
}
 
Example 18
Project: infobip-open-jdk-8   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 19
Project: openjdk-source-code-learn   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 20
Project: OLD-OpenJDK8   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 21
Project: JamVM-PH   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Test catching the user exception, thrown on the remote side.
 */
public void testUserException()
{
  System.out.println("**** Test user exception:");

  ExceptionList exList = orb.create_exception_list();
  exList.add(WeThrowThisExceptionHelper.type());

  Request rq =
    object._create_request(null, "throwException", orb.create_list(1), null,
                           exList, null
                          );

  rq.add_in_arg().insert_long(123);
  rq.invoke();

  UnknownUserException uku = (UnknownUserException) rq.env().exception();
  WeThrowThisException our_exception = WeThrowThisExceptionHelper.extract(uku.except);

  System.out.println("  Our user exception, field " + our_exception.ourField +
                     ", has been thrown on remote side."
                    );
}
 
Example 22
Project: JamVM-PH   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Passes wide (UTF-16) string and narrow (ISO8859_1) string.
 * @see gnu.CORBA.GIOP.CharSets_OSF for supported and default
 * encodings.
 */
public void testWideNarrowStrings()
                           throws BAD_OPERATION
{
  System.out.println("**** Test 8 bit and 16 bit char strings");

  Request rq =
    object._create_request(null, "passCharacters", orb.create_list(0), null);

  rq.add_in_arg().insert_wstring("wide string");
  rq.add_in_arg().insert_string("narrow string");

  rq.set_return_type(orb.get_primitive_tc(TCKind.tk_wstring));

  rq.invoke();

  System.out.println("  Returned ' " + rq.result().value().extract_wstring());
}
 
Example 23
Project: JamVM-PH   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  if (returns != null)
    g.set_result(returns);
  return g;    
}
 
Example 24
Project: JamVM-PH   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns, ExceptionList exceptions,
                              ContextList ctx_list
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  g.set_exceptions(exceptions);
  g.set_context_list(ctx_list);
  if (returns != null)
    g.set_result(returns);
  return g;
}
 
Example 25
Project: JamVM-PH   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(getIor());
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.setORB(orb);

  return request;
}
 
Example 26
Project: JamVM-PH   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns,
  ExceptionList exceptions, ContextList ctx_list
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(ior);
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.set_exceptions(exceptions);
  request.set_context_list(ctx_list);
  request.setORB(orb);

  return request;
}
 
Example 27
Project: openjdk-orb   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 28
Project: classpath   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Test catching the user exception, thrown on the remote side.
 */
public void testUserException()
{
  System.out.println("**** Test user exception:");

  ExceptionList exList = orb.create_exception_list();
  exList.add(WeThrowThisExceptionHelper.type());

  Request rq =
    object._create_request(null, "throwException", orb.create_list(1), null,
                           exList, null
                          );

  rq.add_in_arg().insert_long(123);
  rq.invoke();

  UnknownUserException uku = (UnknownUserException) rq.env().exception();
  WeThrowThisException our_exception = WeThrowThisExceptionHelper.extract(uku.except);

  System.out.println("  Our user exception, field " + our_exception.ourField +
                     ", has been thrown on remote side."
                    );
}
 
Example 29
Project: classpath   File: RequestTest.java   View source code 6 votes vote down vote up
/**
 * Passes wide (UTF-16) string and narrow (ISO8859_1) string.
 * @see gnu.CORBA.GIOP.CharSets_OSF for supported and default
 * encodings.
 */
public void testWideNarrowStrings()
                           throws BAD_OPERATION
{
  System.out.println("**** Test 8 bit and 16 bit char strings");

  Request rq =
    object._create_request(null, "passCharacters", orb.create_list(0), null);

  rq.add_in_arg().insert_wstring("wide string");
  rq.add_in_arg().insert_string("narrow string");

  rq.set_return_type(orb.get_primitive_tc(TCKind.tk_wstring));

  rq.invoke();

  System.out.println("  Returned ' " + rq.result().value().extract_wstring());
}
 
Example 30
Project: classpath   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  if (returns != null)
    g.set_result(returns);
  return g;
}
 
Example 31
Project: classpath   File: SimpleDelegate.java   View source code 6 votes vote down vote up
/**
 * Create the request for the local call.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
                              String operation, NVList parameters,
                              NamedValue returns, ExceptionList exceptions,
                              ContextList ctx_list
                             )
{
  if (orb instanceof OrbFunctional)
    {
      ((OrbFunctional) orb).ensureRunning();
    }
  gnuRequest g = new gnuRequest();
  g.setORB(orb);
  g.setOperation(operation);
  g.setIor(ior);
  g.m_target = target;
  g.ctx(context);
  g.set_args(parameters);
  g.set_exceptions(exceptions);
  g.set_context_list(ctx_list);
  if (returns != null)
    g.set_result(returns);
  return g;
}
 
Example 32
Project: classpath   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(getIor());
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.setORB(orb);

  return request;
}
 
Example 33
Project: classpath   File: IorDelegate.java   View source code 6 votes vote down vote up
/**
 * Creates the request to invoke the method on this object.
 *
 * @param target the object, for that the operation must be invoked.
 * @param context context (null allowed)
 * @param operation the method name
 * @param parameters the method parameters
 * @param returns the return value holder
 *
 * @return the created request.
 */
public Request create_request(org.omg.CORBA.Object target, Context context,
  String operation, NVList parameters, NamedValue returns,
  ExceptionList exceptions, ContextList ctx_list
)
{
  gnuRequest request = getRequestInstance(target);

  request.setIor(ior);
  request.set_target(target);

  request.setOperation(operation);
  request.set_args(parameters);
  request.m_context = context;
  request.set_result(returns);
  request.set_exceptions(exceptions);
  request.set_context_list(ctx_list);
  request.setORB(orb);

  return request;
}
 
Example 34
Project: openjdk-icedtea7   File: ORBImpl.java   View source code 6 votes vote down vote up
/**
 * Send multiple dynamic requests asynchronously.
 *
 * @param req         an array of request objects.
 */
public synchronized void send_multiple_requests_deferred(Request[] req)
{
    checkShutdownState();

    // add the new Requests to pending dynamic Requests
    for (int i = 0; i < req.length; i++) {
        dynamicRequests.addElement(req[i]);
    }

    // Invoke the send_deferred on each new Request
    for (int i = 0; i < req.length; i++) {
        AsynchInvoke invokeObject = new AsynchInvoke( this,
            (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
        new Thread(invokeObject).start();
    }
}
 
Example 35
Project: OpenJSharp   File: CorbaClientDelegateImpl.java   View source code 5 votes vote down vote up
public Request create_request(org.omg.CORBA.Object obj,
                              Context ctx,
                              String operation,
                              NVList arg_list,
                              NamedValue result)
{
    return new RequestImpl(orb, obj, ctx, operation, arg_list,
                           result, null, null);
}
 
Example 36
Project: OpenJSharp   File: CorbaClientDelegateImpl.java   View source code 5 votes vote down vote up
public Request create_request(org.omg.CORBA.Object obj,
                              Context ctx,
                              String operation,
                              NVList arg_list,
                              NamedValue result,
                              ExceptionList exclist,
                              ContextList ctxlist)
{
    return new RequestImpl(orb, obj, ctx, operation, arg_list, result,
                           exclist, ctxlist);
}
 
Example 37
Project: OpenJSharp   File: ORBImpl.java   View source code 5 votes vote down vote up
public synchronized void send_multiple_requests_oneway(Request[] req)
{
    checkShutdownState();

    // Invoke the send_oneway on each new Request
    for (int i = 0; i < req.length; i++) {
        req[i].send_oneway();
    }
}
 
Example 38
Project: OpenJSharp   File: ORBImpl.java   View source code 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 39
Project: openjdk-jdk10   File: CorbaClientDelegateImpl.java   View source code 5 votes vote down vote up
public Request create_request(org.omg.CORBA.Object obj,
                              Context ctx,
                              String operation,
                              NVList arg_list,
                              NamedValue result)
{
    return new RequestImpl(orb, obj, ctx, operation, arg_list,
                           result, null, null);
}
 
Example 40
Project: openjdk-jdk10   File: CorbaClientDelegateImpl.java   View source code 5 votes vote down vote up
public Request create_request(org.omg.CORBA.Object obj,
                              Context ctx,
                              String operation,
                              NVList arg_list,
                              NamedValue result,
                              ExceptionList exclist,
                              ContextList ctxlist)
{
    return new RequestImpl(orb, obj, ctx, operation, arg_list, result,
                           exclist, ctxlist);
}