/**
  * Returns the IdUniquenessPolicyValue, matching the given integer constant.
  *
  * @param code one of _UNIQUE_ID, _MULTIPLE_ID.
  * @return one of UNIQUE_ID, MULTIPLE_ID.
  * @throws BAD_PARAM if the parameter is not one of the valid values.
  */
 public static IdUniquenessPolicyValue from_int(int code) {
   try {
     return enume[code];
   } catch (ArrayIndexOutOfBoundsException ex) {
     BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code);
     bad.minor = Minor.PolicyType;
     throw bad;
   }
 }
 /** Extract the naming context from the given {@link Any}. */
 public static NamingContextExt extract(Any a) {
   try {
     return ((NamingContextExtHolder) a.extract_Streamable()).value;
   } catch (ClassCastException ex) {
     BAD_OPERATION bad = new BAD_OPERATION("NamingContextExt expected");
     bad.initCause(ex);
     bad.minor = Minor.Any;
     throw bad;
   }
 }
 /**
  * Extract the TaggedComponent from given Any. This method uses the TaggedComponentHolder.
  *
  * @throws BAD_OPERATION if the passed Any does not contain TaggedComponent.
  */
 public static TaggedComponent extract(Any any) {
   try {
     return ((TaggedComponentHolder) any.extract_Streamable()).value;
   } catch (ClassCastException cex) {
     BAD_OPERATION bad = new BAD_OPERATION("TaggedComponent expected");
     bad.minor = Minor.Any;
     bad.initCause(cex);
     throw bad;
   }
 }
 /**
  * Extract the ObjectNotActive from given Any.
  *
  * @throws BAD_OPERATION if the passed Any does not contain ObjectNotActive.
  */
 public static ObjectNotActive extract(Any any) {
   try {
     EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable();
     return (ObjectNotActive) h.value;
   } catch (ClassCastException cex) {
     BAD_OPERATION bad = new BAD_OPERATION("ObjectNotActive expected");
     bad.minor = Minor.Any;
     bad.initCause(cex);
     throw bad;
   }
 }
Exemplo n.º 5
0
  public BAD_OPERATION orbIdNotAvailable(CompletionStatus cs, Throwable t) {
    BAD_OPERATION exc = new BAD_OPERATION(ORB_ID_NOT_AVAILABLE, cs);
    if (t != null) exc.initCause(t);

    if (logger.isLoggable(Level.WARNING)) {
      Object[] parameters = null;
      doLog(Level.WARNING, "IOR.orbIdNotAvailable", parameters, IORSystemException.class, exc);
    }

    return exc;
  }
  public BAD_OPERATION exceptionInLoadStub(CompletionStatus cs, Throwable t) {
    BAD_OPERATION exc = new BAD_OPERATION(EXCEPTION_IN_LOAD_STUB, cs);
    if (t != null) exc.initCause(t);

    if (logger.isLoggable(Level.FINE)) {
      Object[] parameters = null;
      doLog(Level.FINE, "UTIL.exceptionInLoadStub", parameters, UtilSystemException.class, exc);
    }

    return exc;
  }
  public BAD_OPERATION errorInMakeStubFromRepositoryId(CompletionStatus cs, Throwable t) {
    BAD_OPERATION exc = new BAD_OPERATION(ERROR_IN_MAKE_STUB_FROM_REPOSITORY_ID, cs);
    if (t != null) exc.initCause(t);

    if (logger.isLoggable(Level.FINE)) {
      Object[] parameters = null;
      doLog(
          Level.FINE,
          "UTIL.errorInMakeStubFromRepositoryId",
          parameters,
          UtilSystemException.class,
          exc);
    }

    return exc;
  }
  public BAD_OPERATION stubFactoryCouldNotMakeStub(CompletionStatus cs, Throwable t) {
    BAD_OPERATION exc = new BAD_OPERATION(STUB_FACTORY_COULD_NOT_MAKE_STUB, cs);
    if (t != null) exc.initCause(t);

    if (logger.isLoggable(Level.FINE)) {
      Object[] parameters = null;
      doLog(
          Level.FINE,
          "UTIL.stubFactoryCouldNotMakeStub",
          parameters,
          UtilSystemException.class,
          exc);
    }

    return exc;
  }