Java 类org.omg.CORBA.UnknownUserException 实例源码

项目:javify    文件:RequestTest.java   
/**
 * 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."
                    );
}
项目:javify    文件:gnuRequest.java   
/** @inheritDoc */
public Any received_exception()
{
  if (m_exception_id == null)
    return null;

  if (m_sys_ex != null)
    {
      Any a = orb.create_any();
      ObjectCreator.insertSysException(a, m_sys_ex);
      return a;
    }

  Exception mex = m_environment.exception();

  UnknownUserException ex = (UnknownUserException) mex;
  if (ex == null)
    return null;
  else
    return ex.except;
}
项目:jvm-stm    文件:RequestTest.java   
/**
 * 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."
                    );
}
项目:jvm-stm    文件:gnuRequest.java   
/** @inheritDoc */
public Any received_exception()
{
  if (m_exception_id == null)
    return null;

  if (m_sys_ex != null)
    {
      Any a = orb.create_any();
      ObjectCreator.insertSysException(a, m_sys_ex);
      return a;
    }

  Exception mex = m_environment.exception();

  UnknownUserException ex = (UnknownUserException) mex;
  if (ex == null)
    return null;
  else
    return ex.except;
}
项目:JamVM-PH    文件:RequestTest.java   
/**
 * 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."
                    );
}
项目:JamVM-PH    文件:gnuRequest.java   
/** @inheritDoc */
public Any received_exception()
{
  if (m_exception_id == null)
    return null;

  if (m_sys_ex != null)
    {
      Any a = orb.create_any();
      ObjectCreator.insertSysException(a, m_sys_ex);
      return a;
    }

  Exception mex = m_environment.exception();

  UnknownUserException ex = (UnknownUserException) mex;
  if (ex == null)
    return null;
  else
    return ex.except;
}
项目:classpath    文件:RequestTest.java   
/**
 * 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."
                    );
}
项目:classpath    文件:gnuRequest.java   
/** @inheritDoc */
public Any received_exception()
{
  if (m_exception_id == null)
    return null;

  if (m_sys_ex != null)
    {
      Any a = orb.create_any();
      ObjectCreator.insertSysException(a, m_sys_ex);
      return a;
    }

  Exception mex = m_environment.exception();

  UnknownUserException ex = (UnknownUserException) mex;
  if (ex == null)
    return null;
  else
    return ex.except;
}
项目:TIDorbJ    文件:UserExceptionEncoder.java   
public static org.omg.CORBA.UnknownUserException
    read(org.omg.CORBA.portable.InputStream in,
         org.omg.CORBA.TypeCode[] types)
{
    String name = in.read_string();

    try {
        if (types != null)
            for (int i = 0; i < types.length; i++) {
                if (types[i].kind().value() != TCKind._tk_except)
                    throw new 
                    BAD_PARAM("Bad ExceptionList: not Exception TypeCode");

                if (name.equals(types[i].name())) {
                    Any any = in.orb().create_any();
                    any.read_value(in, types[i]);
                    return new UnknownUserException(any);
                }
            }
    }
    catch (BadKind bk) {}
    throw new UNKNOWN("Unexpected exception: " + name);
}
项目:OpenJSharp    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:openjdk-jdk10    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:openjdk9    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:lookaside_java-1.8.0-openjdk    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:jdk8u_corba    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:infobip-open-jdk-8    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:openjdk-source-code-learn    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:OLD-OpenJDK8    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:openjdk-orb    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:openjdk-icedtea7    文件:CorbaMessageMediatorImpl.java   
public Exception unmarshalDIIUserException(String repoId, InputStream is)
{
    if (! isDIIRequest()) {
        return null;
    }

    ExceptionList _exceptions = diiRequest.exceptions();

    try {
        // Find the typecode for the exception
        for (int i=0; i<_exceptions.count() ; i++) {
            TypeCode tc = _exceptions.item(i);
            if ( tc.id().equals(repoId) ) {
                // Since we dont have the actual user exception
                // class, the spec says we have to create an
                // UnknownUserException and put it in the
                // environment.
                Any eany = orb.create_any();
                eany.read_value(is, (TypeCode)tc);

                return new UnknownUserException(eany);
            }
        }
    } catch (Exception b) {
        throw wrapper.unexpectedDiiException(b);
    }

    // must be a truly unknown exception
    return wrapper.unknownCorbaExc( CompletionStatus.COMPLETED_MAYBE);
}
项目:javify    文件:LocalServerRequest.java   
/**
 * Set the exception that has been thrown.
 */
public void set_exception(Any exc)
{
  request.env().exception(new UnknownUserException(exc));
}
项目:javify    文件:LocalRequest.java   
/**
 * Make an invocation and store the result in the fields of this Request. Used
 * with DII only.
 */
public void invoke()
{
  InvokeHandler handler = object.getHandler(operation(), cookie, false);

  if (handler instanceof DynamicImpHandler)
    {
      DynamicImplementation dyn = ((DynamicImpHandler) handler).servant;
      if (serverRequest == null)
        {
          serverRequest = new LocalServerRequest(this);
        }
      try
        {
          poa.m_orb.currents.put(Thread.currentThread(), this);
          dyn.invoke(serverRequest);
        }
      finally
        {
          poa.m_orb.currents.remove(Thread.currentThread());
        }
    }
  else
    {
      org.omg.CORBA.portable.InputStream input = v_invoke(handler);

      if (!exceptionReply)
        {
          NamedValue arg;

          // Read return value, if set.
          if (m_result != null)
            {
              m_result.value().read_value(input, m_result.value().type());
            }

          // Read returned parameters, if set.
          if (m_args != null)
            {
              for (int i = 0; i < m_args.count(); i++)
                {
                  try
                    {
                      arg = m_args.item(i);

                      // Both ARG_INOUT and ARG_OUT have this binary flag set.
                      if ((arg.flags() & ARG_OUT.value) != 0)
                        {
                          arg.value().read_value(input, arg.value().type());
                        }
                    }
                  catch (Bounds ex)
                    {
                      Unexpected.error(ex);
                    }
                }
            }
        }
      else// User exception reply
        {
          // Prepare an Any that will hold the exception.
          gnuAny exc = new gnuAny();

          exc.insert_Streamable(new StreamHolder(input));

          UnknownUserException unuex = new UnknownUserException(exc);
          m_environment.exception(unuex);
        }
    }
}
项目:jvm-stm    文件:LocalServerRequest.java   
/**
 * Set the exception that has been thrown.
 */
public void set_exception(Any exc)
{
  request.env().exception(new UnknownUserException(exc));
}
项目:jvm-stm    文件:LocalRequest.java   
/**
 * Make an invocation and store the result in the fields of this Request. Used
 * with DII only.
 */
public void invoke()
{
  InvokeHandler handler = object.getHandler(operation(), cookie, false);

  if (handler instanceof DynamicImpHandler)
    {
      DynamicImplementation dyn = ((DynamicImpHandler) handler).servant;
      if (serverRequest == null)
        {
          serverRequest = new LocalServerRequest(this);
        }
      try
        {
          poa.m_orb.currents.put(Thread.currentThread(), this);
          dyn.invoke(serverRequest);
        }
      finally
        {
          poa.m_orb.currents.remove(Thread.currentThread());
        }
    }
  else
    {
      org.omg.CORBA.portable.InputStream input = v_invoke(handler);

      if (!exceptionReply)
        {
          NamedValue arg;

          // Read return value, if set.
          if (m_result != null)
            {
              m_result.value().read_value(input, m_result.value().type());
            }

          // Read returned parameters, if set.
          if (m_args != null)
            {
              for (int i = 0; i < m_args.count(); i++)
                {
                  try
                    {
                      arg = m_args.item(i);

                      // Both ARG_INOUT and ARG_OUT have this binary flag set.
                      if ((arg.flags() & ARG_OUT.value) != 0)
                        {
                          arg.value().read_value(input, arg.value().type());
                        }
                    }
                  catch (Bounds ex)
                    {
                      Unexpected.error(ex);
                    }
                }
            }
        }
      else// User exception reply
        {
          // Prepare an Any that will hold the exception.
          gnuAny exc = new gnuAny();

          exc.insert_Streamable(new StreamHolder(input));

          UnknownUserException unuex = new UnknownUserException(exc);
          m_environment.exception(unuex);
        }
    }
}
项目:JamVM-PH    文件:LocalServerRequest.java   
/**
 * Set the exception that has been thrown.
 */
public void set_exception(Any exc)
{
  request.env().exception(new UnknownUserException(exc));
}
项目:JamVM-PH    文件:LocalRequest.java   
/**
 * Make an invocation and store the result in the fields of this Request. Used
 * with DII only.
 */
public void invoke()
{
  InvokeHandler handler = object.getHandler(operation(), cookie, false);

  if (handler instanceof DynamicImpHandler)
    {
      DynamicImplementation dyn = ((DynamicImpHandler) handler).servant;
      if (serverRequest == null)
        {
          serverRequest = new LocalServerRequest(this);
        }
      try
        {
          poa.m_orb.currents.put(Thread.currentThread(), this);
          dyn.invoke(serverRequest);
        }
      finally
        {
          poa.m_orb.currents.remove(Thread.currentThread());
        }
    }
  else
    {
      org.omg.CORBA.portable.InputStream input = v_invoke(handler);

      if (!exceptionReply)
        {
          NamedValue arg;

          // Read return value, if set.
          if (m_result != null)
            {
              m_result.value().read_value(input, m_result.value().type());
            }

          // Read returned parameters, if set.
          if (m_args != null)
            {
              for (int i = 0; i < m_args.count(); i++)
                {
                  try
                    {
                      arg = m_args.item(i);

                      // Both ARG_INOUT and ARG_OUT have this binary flag set.
                      if ((arg.flags() & ARG_OUT.value) != 0)
                        {
                          arg.value().read_value(input, arg.value().type());
                        }
                    }
                  catch (Bounds ex)
                    {
                      Unexpected.error(ex);
                    }
                }
            }
        }
      else// User exception reply
        {
          // Prepare an Any that will hold the exception.
          gnuAny exc = new gnuAny();

          exc.insert_Streamable(new StreamHolder(input));

          UnknownUserException unuex = new UnknownUserException(exc);
          m_environment.exception(unuex);
        }
    }
}
项目:classpath    文件:LocalServerRequest.java   
/**
 * Set the exception that has been thrown.
 */
public void set_exception(Any exc)
{
  request.env().exception(new UnknownUserException(exc));
}
项目:classpath    文件:LocalRequest.java   
/**
 * Make an invocation and store the result in the fields of this Request. Used
 * with DII only.
 */
public void invoke()
{
  InvokeHandler handler = object.getHandler(operation(), cookie, false);

  if (handler instanceof DynamicImpHandler)
    {
      DynamicImplementation dyn = ((DynamicImpHandler) handler).servant;
      if (serverRequest == null)
        {
          serverRequest = new LocalServerRequest(this);
        }
      try
        {
          poa.m_orb.currents.put(Thread.currentThread(), this);
          dyn.invoke(serverRequest);
        }
      finally
        {
          poa.m_orb.currents.remove(Thread.currentThread());
        }
    }
  else
    {
      org.omg.CORBA.portable.InputStream input = v_invoke(handler);

      if (!exceptionReply)
        {
          NamedValue arg;

          // Read return value, if set.
          if (m_result != null)
            {
              m_result.value().read_value(input, m_result.value().type());
            }

          // Read returned parameters, if set.
          if (m_args != null)
            {
              for (int i = 0; i < m_args.count(); i++)
                {
                  try
                    {
                      arg = m_args.item(i);

                      // Both ARG_INOUT and ARG_OUT have this binary flag set.
                      if ((arg.flags() & ARG_OUT.value) != 0)
                        {
                          arg.value().read_value(input, arg.value().type());
                        }
                    }
                  catch (Bounds ex)
                    {
                      Unexpected.error(ex);
                    }
                }
            }
        }
      else// User exception reply
        {
          // Prepare an Any that will hold the exception.
          gnuAny exc = new gnuAny();

          exc.insert_Streamable(new StreamHolder(input));

          UnknownUserException unuex = new UnknownUserException(exc);
          m_environment.exception(unuex);
        }
    }
}
项目:TIDorbJ    文件:RequestImpl.java   
public void setUserException(Any exc)
{
    m_environment.exception(new UnknownUserException(exc));
}