Java Code Examples for org.omg.CORBA.UserException

The following are top voted examples for showing how to use org.omg.CORBA.UserException. 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: javify   File: DirectTest.java   Source Code and License 6 votes vote down vote up
/**
 * Test catching the system exception, thrown on the remote side.
 */
public void testSystemException()
{
  System.out.println("**** Test system exception:");
  try
    {
      // Negative parameter = system exception.
      object.throwException(-55);
    }
  catch (BAD_OPERATION ex)
    {
      System.out.println("  The expected BAD_OPERATION, minor code " +
                         ex.minor + ", has been thrown on remote side."
                        );
    }
  catch (UserException uex)
    {
      throw new InternalError();
    }
}
 
Example 2
Project: javify   File: gnuDynAnyFactory.java   Source Code and License 6 votes vote down vote up
/**
 * Create the DynAny using the passed value as template and assign this value.
 */
public DynAny create_dyn_any(Any value)
                      throws InconsistentTypeCode
{
  DynAny created = create_dyn_any_from_type_code(value.type());
  try
    {
      created.from_any(value);
    }
  catch (UserException uex)
    {
      InconsistentTypeCode t = new InconsistentTypeCode("Inconsistent Any");
      t.initCause(uex);
      throw t;
    }
  catch (Exception e)
    {
      throw new Unexpected(e);
    }
  return created;
}
 
Example 3
Project: javify   File: ObjectCreator.java   Source Code and License 6 votes vote down vote up
/**
 * Reads the user exception, having the given Id, from the input stream. The
 * id is expected to be in the form like
 * 'IDL:test/org/omg/CORBA/ORB/communication/ourUserException:1.0'
 *
 * @param idl the exception idl name.
 * @param input the stream to read from.
 *
 * @return the loaded exception.
 * @return null if the helper class cannot be found.
 */
public static UserException readUserException(String idl, InputStream input)
{
  try
    {
      Class helperClass = findHelper(idl);

      Method read = helperClass.getMethod("read",
        new Class[] { org.omg.CORBA.portable.InputStream.class });

      return (UserException) read.invoke(null, new Object[] { input });
    }
  catch (MARSHAL mex)
    {
      // This one is ok to throw
      throw mex;
    }
  catch (Exception ex)
    {
      ex.printStackTrace();
      return null;
    }
}
 
Example 4
Project: jvm-stm   File: DirectTest.java   Source Code and License 6 votes vote down vote up
/**
 * Test catching the system exception, thrown on the remote side.
 */
public void testSystemException()
{
  System.out.println("**** Test system exception:");
  try
    {
      // Negative parameter = system exception.
      object.throwException(-55);
    }
  catch (BAD_OPERATION ex)
    {
      System.out.println("  The expected BAD_OPERATION, minor code " +
                         ex.minor + ", has been thrown on remote side."
                        );
    }
  catch (UserException uex)
    {
      throw new InternalError();
    }
}
 
Example 5
Project: jvm-stm   File: gnuDynAnyFactory.java   Source Code and License 6 votes vote down vote up
/**
 * Create the DynAny using the passed value as template and assign this value.
 */
public DynAny create_dyn_any(Any value)
                      throws InconsistentTypeCode
{
  DynAny created = create_dyn_any_from_type_code(value.type());
  try
    {
      created.from_any(value);
    }
  catch (UserException uex)
    {
      InconsistentTypeCode t = new InconsistentTypeCode("Inconsistent Any");
      t.initCause(uex);
      throw t;
    }
  catch (Exception e)
    {
      throw new Unexpected(e);
    }
  return created;
}
 
Example 6
Project: jvm-stm   File: ObjectCreator.java   Source Code and License 6 votes vote down vote up
/**
 * Reads the user exception, having the given Id, from the input stream. The
 * id is expected to be in the form like
 * 'IDL:test/org/omg/CORBA/ORB/communication/ourUserException:1.0'
 * 
 * @param idl the exception idl name.
 * @param input the stream to read from.
 * 
 * @return the loaded exception.
 * @return null if the helper class cannot be found.
 */
public static UserException readUserException(String idl, InputStream input)
{
  try
    {
      Class helperClass = findHelper(idl);

      Method read = helperClass.getMethod("read",
        new Class[] { org.omg.CORBA.portable.InputStream.class });

      return (UserException) read.invoke(null, new Object[] { input });
    }
  catch (MARSHAL mex)
    {
      // This one is ok to throw
      throw mex;
    }
  catch (Exception ex)
    {
      ex.printStackTrace();
      return null;
    }
}
 
Example 7
Project: JamVM-PH   File: DirectTest.java   Source Code and License 6 votes vote down vote up
/**
 * Test catching the system exception, thrown on the remote side.
 */
public void testSystemException()
{
  System.out.println("**** Test system exception:");
  try
    {
      // Negative parameter = system exception.
      object.throwException(-55);
    }
  catch (BAD_OPERATION ex)
    {
      System.out.println("  The expected BAD_OPERATION, minor code " +
                         ex.minor + ", has been thrown on remote side."
                        );
    }
  catch (UserException uex)
    {
      throw new InternalError();
    }
}
 
Example 8
Project: JamVM-PH   File: gnuDynAnyFactory.java   Source Code and License 6 votes vote down vote up
/**
 * Create the DynAny using the passed value as template and assign this value.
 */
public DynAny create_dyn_any(Any value)
                      throws InconsistentTypeCode
{
  DynAny created = create_dyn_any_from_type_code(value.type());
  try
    {
      created.from_any(value);
    }
  catch (UserException uex)
    {
      InconsistentTypeCode t = new InconsistentTypeCode("Inconsistent Any");
      t.initCause(uex);
      throw t;
    }
  catch (Exception e)
    {
      throw new Unexpected(e);
    }
  return created;
}
 
Example 9
Project: JamVM-PH   File: ObjectCreator.java   Source Code and License 6 votes vote down vote up
/**
 * Reads the user exception, having the given Id, from the input stream. The
 * id is expected to be in the form like
 * 'IDL:test/org/omg/CORBA/ORB/communication/ourUserException:1.0'
 * 
 * @param idl the exception idl name.
 * @param input the stream to read from.
 * 
 * @return the loaded exception.
 * @return null if the helper class cannot be found.
 */
public static UserException readUserException(String idl, InputStream input)
{
  try
    {
      Class helperClass = findHelper(idl);

      Method read = helperClass.getMethod("read",
        new Class[] { org.omg.CORBA.portable.InputStream.class });

      return (UserException) read.invoke(null, new Object[] { input });
    }
  catch (MARSHAL mex)
    {
      // This one is ok to throw
      throw mex;
    }
  catch (Exception ex)
    {
      ex.printStackTrace();
      return null;
    }
}
 
Example 10
Project: openjdk-orb   File: INSURLOperationImpl.java   Source Code and License 6 votes vote down vote up
private void createSSLTaggedComponent(IIOPProfileTemplate profileTemplate, int port) throws UserException
{
    SSL ssl = new SSL();
    ssl.port = (short) port;

    short sslOptions = Integrity.value | Confidentiality.value | DetectMisordering.value | DetectReplay.value
            | EstablishTrustInTarget.value | EstablishTrustInClient.value;
    ssl.target_supports = sslOptions;
    ssl.target_requires = sslOptions;

    GIOPVersion giopVersion = orb.getORBData().getGIOPVersion();
    CDREncapsCodec codec = new CDREncapsCodec(orb, giopVersion.getMajor(),giopVersion.getMinor());

    Any any = orb.create_any();
    SSLHelper.insert(any, ssl);
    byte[] componentData = codec.encode_value(any);

    TaggedComponent sslTaggedComponent = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData);

    TaggedComponentFactoryFinder finder =
            orb.getTaggedComponentFactoryFinder();
    Object newTaggedComponent = finder.create( orb, sslTaggedComponent);

    profileTemplate.add(newTaggedComponent);
}
 
Example 11
Project: classpath   File: DirectTest.java   Source Code and License 6 votes vote down vote up
/**
 * Test catching the system exception, thrown on the remote side.
 */
public void testSystemException()
{
  System.out.println("**** Test system exception:");
  try
    {
      // Negative parameter = system exception.
      object.throwException(-55);
    }
  catch (BAD_OPERATION ex)
    {
      System.out.println("  The expected BAD_OPERATION, minor code " +
                         ex.minor + ", has been thrown on remote side."
                        );
    }
  catch (UserException uex)
    {
      throw new InternalError();
    }
}
 
Example 12
Project: classpath   File: gnuDynAnyFactory.java   Source Code and License 6 votes vote down vote up
/**
 * Create the DynAny using the passed value as template and assign this value.
 */
public DynAny create_dyn_any(Any value)
                      throws InconsistentTypeCode
{
  DynAny created = create_dyn_any_from_type_code(value.type());
  try
    {
      created.from_any(value);
    }
  catch (UserException uex)
    {
      InconsistentTypeCode t = new InconsistentTypeCode("Inconsistent Any");
      t.initCause(uex);
      throw t;
    }
  catch (Exception e)
    {
      throw new Unexpected(e);
    }
  return created;
}
 
Example 13
Project: classpath   File: ObjectCreator.java   Source Code and License 6 votes vote down vote up
/**
 * Reads the user exception, having the given Id, from the input stream. The
 * id is expected to be in the form like
 * 'IDL:test/org/omg/CORBA/ORB/communication/ourUserException:1.0'
 *
 * @param idl the exception idl name.
 * @param input the stream to read from.
 *
 * @return the loaded exception.
 * @return null if the helper class cannot be found.
 */
public static UserException readUserException(String idl, InputStream input)
{
  try
    {
      Class helperClass = findHelper(idl);

      Method read = helperClass.getMethod("read",
        new Class[] { org.omg.CORBA.portable.InputStream.class });

      return (UserException) read.invoke(null, new Object[] { input });
    }
  catch (MARSHAL mex)
    {
      // This one is ok to throw
      throw mex;
    }
  catch (Exception ex)
    {
      ex.printStackTrace();
      return null;
    }
}
 
Example 14
Project: javify   File: AbstractCdrOutput.java   Source Code and License 5 votes vote down vote up
/**
 * Write the TypeCode. This implementation delegates functionality
 * to {@link cdrTypeCode}.
 *
 * @param x a TypeCode to write.
 */
public void write_TypeCode(TypeCode x)
{
  try
    {
      TypeCodeHelper.write(this, x);
    }
  catch (UserException ex)
    {
      Unexpected.error(ex);
    }
}
 
Example 15
Project: javify   File: CdrEncapsCodecImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Checks if the given type can be encoded. Currently only checks for wide
 * strings and wide chars for GIOP 1.0.
 *
 * @param t a typecode to chek.
 *
 * @throws InvalidTypeForEncoding if the typecode is not valid for the given
 * version.
 */
private void checkTypePossibility(String name, TypeCode t)
                           throws InvalidTypeForEncoding
{
  if (noWide)
    {
      try
        {
          int kind = t.kind().value();

          if (kind == TCKind._tk_wchar || kind == TCKind._tk_wstring)
            throw new InvalidTypeForEncoding(name + " wide char in " +
                                             version
                                            );
          else if (kind == TCKind._tk_alias || kind == TCKind._tk_array ||
                   kind == TCKind._tk_sequence
                  )
            checkTypePossibility("Array member", t.content_type());

          else if (kind == TCKind._tk_struct || kind == TCKind._tk_union)
            {
              for (int i = 0; i < t.member_count(); i++)
                {
                  checkTypePossibility(t.member_name(i), t.member_type(i));
                }
            }
        }
      catch (UserException ex)
        {
          InternalError ierr = new InternalError();
          ierr.initCause(ex);
          throw ierr;
        }
    }
}
 
Example 16
Project: javify   File: ObjectCreator.java   Source Code and License 5 votes vote down vote up
/**
 * Insert this exception into the given Any. On failure, insert the UNKNOWN
 * exception.
 */
public static void insertException(Any into, Throwable exception)
{
  boolean ok = false;
  if (exception instanceof SystemException)
    ok = insertSysException(into, (SystemException) exception);
  else if (exception instanceof UserException)
    ok = insertWithHelper(into, exception);

  if (!ok)
    ok = insertSysException(into, new UNKNOWN());
  if (!ok)
    throw new InternalError("Exception wrapping broken");
}
 
Example 17
Project: jvm-stm   File: AbstractCdrOutput.java   Source Code and License 5 votes vote down vote up
/**
 * Write the TypeCode. This implementation delegates functionality
 * to {@link cdrTypeCode}.
 *
 * @param x a TypeCode to write.
 */
public void write_TypeCode(TypeCode x)
{
  try
    {
      TypeCodeHelper.write(this, x);
    }
  catch (UserException ex)
    {
      Unexpected.error(ex);
    }
}
 
Example 18
Project: jvm-stm   File: CdrEncapsCodecImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Checks if the given type can be encoded. Currently only checks for wide
 * strings and wide chars for GIOP 1.0.
 *
 * @param t a typecode to chek.
 *
 * @throws InvalidTypeForEncoding if the typecode is not valid for the given
 * version.
 */
private void checkTypePossibility(String name, TypeCode t)
                           throws InvalidTypeForEncoding
{
  if (noWide)
    {
      try
        {
          int kind = t.kind().value();

          if (kind == TCKind._tk_wchar || kind == TCKind._tk_wstring)
            throw new InvalidTypeForEncoding(name + " wide char in " +
                                             version
                                            );
          else if (kind == TCKind._tk_alias || kind == TCKind._tk_array ||
                   kind == TCKind._tk_sequence
                  )
            checkTypePossibility("Array member", t.content_type());

          else if (kind == TCKind._tk_struct || kind == TCKind._tk_union)
            {
              for (int i = 0; i < t.member_count(); i++)
                {
                  checkTypePossibility(t.member_name(i), t.member_type(i));
                }
            }
        }
      catch (UserException ex)
        {
          InternalError ierr = new InternalError();
          ierr.initCause(ex);
          throw ierr;
        }
    }
}
 
Example 19
Project: jvm-stm   File: ObjectCreator.java   Source Code and License 5 votes vote down vote up
/**
 * Insert this exception into the given Any. On failure, insert the UNKNOWN
 * exception.
 */
public static void insertException(Any into, Throwable exception)
{
  boolean ok = false;
  if (exception instanceof SystemException)
    ok = insertSysException(into, (SystemException) exception);
  else if (exception instanceof UserException)
    ok = insertWithHelper(into, exception);

  if (!ok)
    ok = insertSysException(into, new UNKNOWN());
  if (!ok)
    throw new InternalError("Exception wrapping broken");
}
 
Example 20
Project: rmiio   File: IIOPRemoteStreamExporter.java   Source Code and License 5 votes vote down vote up
public Object export(Remote server, Class<?> remoteClass)
  throws RemoteException
{
  try {
    PortableRemoteObject.exportObject(server);
    POA poa = getPOA();
    Object servant = Util.getTie(server);
    Object ref = poa.servant_to_reference((Servant)servant);
    return PortableRemoteObject.narrow(ref, remoteClass);
  } catch(UserException e) {
    throw new ExportException("could not export corba stream servant", e);
  }
}
 
Example 21
Project: JamVM-PH   File: AbstractCdrOutput.java   Source Code and License 5 votes vote down vote up
/**
 * Write the TypeCode. This implementation delegates functionality
 * to {@link cdrTypeCode}.
 *
 * @param x a TypeCode to write.
 */
public void write_TypeCode(TypeCode x)
{
  try
    {
      TypeCodeHelper.write(this, x);
    }
  catch (UserException ex)
    {
      Unexpected.error(ex);
    }
}
 
Example 22
Project: JamVM-PH   File: CdrEncapsCodecImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Checks if the given type can be encoded. Currently only checks for wide
 * strings and wide chars for GIOP 1.0.
 *
 * @param t a typecode to chek.
 *
 * @throws InvalidTypeForEncoding if the typecode is not valid for the given
 * version.
 */
private void checkTypePossibility(String name, TypeCode t)
                           throws InvalidTypeForEncoding
{
  if (noWide)
    {
      try
        {
          int kind = t.kind().value();

          if (kind == TCKind._tk_wchar || kind == TCKind._tk_wstring)
            throw new InvalidTypeForEncoding(name + " wide char in " +
                                             version
                                            );
          else if (kind == TCKind._tk_alias || kind == TCKind._tk_array ||
                   kind == TCKind._tk_sequence
                  )
            checkTypePossibility("Array member", t.content_type());

          else if (kind == TCKind._tk_struct || kind == TCKind._tk_union)
            {
              for (int i = 0; i < t.member_count(); i++)
                {
                  checkTypePossibility(t.member_name(i), t.member_type(i));
                }
            }
        }
      catch (UserException ex)
        {
          InternalError ierr = new InternalError();
          ierr.initCause(ex);
          throw ierr;
        }
    }
}
 
Example 23
Project: JamVM-PH   File: ObjectCreator.java   Source Code and License 5 votes vote down vote up
/**
 * Insert this exception into the given Any. On failure, insert the UNKNOWN
 * exception.
 */
public static void insertException(Any into, Throwable exception)
{
  boolean ok = false;
  if (exception instanceof SystemException)
    ok = insertSysException(into, (SystemException) exception);
  else if (exception instanceof UserException)
    ok = insertWithHelper(into, exception);

  if (!ok)
    ok = insertSysException(into, new UNKNOWN());
  if (!ok)
    throw new InternalError("Exception wrapping broken");
}
 
Example 24
Project: classpath   File: AbstractCdrOutput.java   Source Code and License 5 votes vote down vote up
/**
 * Write the TypeCode. This implementation delegates functionality
 * to {@link cdrTypeCode}.
 *
 * @param x a TypeCode to write.
 */
public void write_TypeCode(TypeCode x)
{
  try
    {
      TypeCodeHelper.write(this, x);
    }
  catch (UserException ex)
    {
      Unexpected.error(ex);
    }
}
 
Example 25
Project: classpath   File: CdrEncapsCodecImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Checks if the given type can be encoded. Currently only checks for wide
 * strings and wide chars for GIOP 1.0.
 *
 * @param t a typecode to chek.
 *
 * @throws InvalidTypeForEncoding if the typecode is not valid for the given
 * version.
 */
private void checkTypePossibility(String name, TypeCode t)
                           throws InvalidTypeForEncoding
{
  if (noWide)
    {
      try
        {
          int kind = t.kind().value();

          if (kind == TCKind._tk_wchar || kind == TCKind._tk_wstring)
            throw new InvalidTypeForEncoding(name + " wide char in " +
                                             version
                                            );
          else if (kind == TCKind._tk_alias || kind == TCKind._tk_array ||
                   kind == TCKind._tk_sequence
                  )
            checkTypePossibility("Array member", t.content_type());

          else if (kind == TCKind._tk_struct || kind == TCKind._tk_union)
            {
              for (int i = 0; i < t.member_count(); i++)
                {
                  checkTypePossibility(t.member_name(i), t.member_type(i));
                }
            }
        }
      catch (UserException ex)
        {
          InternalError ierr = new InternalError();
          ierr.initCause(ex);
          throw ierr;
        }
    }
}
 
Example 26
Project: classpath   File: ObjectCreator.java   Source Code and License 5 votes vote down vote up
/**
 * Insert this exception into the given Any. On failure, insert the UNKNOWN
 * exception.
 */
public static void insertException(Any into, Throwable exception)
{
  boolean ok = false;
  if (exception instanceof SystemException)
    ok = insertSysException(into, (SystemException) exception);
  else if (exception instanceof UserException)
    ok = insertWithHelper(into, exception);

  if (!ok)
    ok = insertSysException(into, new UNKNOWN());
  if (!ok)
    throw new InternalError("Exception wrapping broken");
}
 
Example 27
Project: OpenJSharp   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 28
Project: openjdk-jdk10   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 29
Project: openjdk9   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 30
Project: lookaside_java-1.8.0-openjdk   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 31
Project: jdk8u_corba   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 32
Project: infobip-open-jdk-8   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 33
Project: openjdk-source-code-learn   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 34
Project: OLD-OpenJDK8   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 35
Project: openjdk-orb   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 36
Project: openjdk-icedtea7   File: PIHandlerImpl.java   Source Code and License 4 votes vote down vote up
public void invokeClientPIStartingPoint()
    throws RemarshalException
{
    if( !hasClientInterceptors ) return;
    if( !isClientPIEnabledForThisThread() ) return;

    // Invoke the starting interception points and record exception
    // and reply status info in the info object:
    ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
    interceptorInvoker.invokeClientInterceptorStartingPoint( info );

    // Check reply status.  If we will not have another chance later
    // to invoke the client ending points, do it now.
    short replyStatus = info.getReplyStatus();
    if( (replyStatus == SYSTEM_EXCEPTION.value) ||
        (replyStatus == LOCATION_FORWARD.value) )
    {
        // Note: Transport retry cannot happen here since this happens
        // before the request hits the wire.

        Exception exception = invokeClientPIEndingPoint(
            convertPIReplyStatusToReplyMessage( replyStatus ),
            info.getException() );
        if( exception == null ) {
            // Do not throw anything.  Otherwise, it must be a
            // SystemException, UserException or RemarshalException.
        } if( exception instanceof SystemException ) {
            throw (SystemException)exception;
        } else if( exception instanceof RemarshalException ) {
            throw (RemarshalException)exception;
        } else if( (exception instanceof UserException) ||
                 (exception instanceof ApplicationException) ) {
            // It should not be possible for an interceptor to throw
            // a UserException.  By asserting instead of throwing the
            // UserException, we need not declare anything but
            // RemarshalException in the throws clause.
            throw wrapper.exceptionInvalid() ;
        }
    }
    else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
        throw wrapper.replyStatusNotInit() ;
    }
}
 
Example 37
Project: TIDorbJ   File: _ExceptionHolderImpl.java   Source Code and License 4 votes vote down vote up
public void raise_exception_with_list(org.omg.CORBA.TypeCode[] exc_list)
    throws org.omg.CORBA.UserException
{
    throw new NO_IMPLEMENT();
}