protected void setLocatedIOR(IOR ior) {
    ORB orb = (ORB) messageMediator.getBroker();

    CorbaContactInfoListIterator iterator =
        (CorbaContactInfoListIterator)
            ((CorbaInvocationInfo) orb.getInvocationInfo()).getContactInfoListIterator();

    // REVISIT - this most likely causes reportRedirect to happen twice.
    // Once here and once inside the request dispatcher.
    iterator.reportRedirect((CorbaContactInfo) messageMediator.getContactInfo(), ior);
  }
 private IOR getLocatedIOR() {
   IOR ior;
   CorbaContactInfoList contactInfoList =
       (CorbaContactInfoList) messageMediator.getContactInfo().getContactInfoList();
   ior = contactInfoList.getEffectiveTargetIOR();
   return ior;
 }
 /** Stores the various sources of information used for this info object. */
 protected void setInfo(
     CorbaMessageMediator request, ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp) {
   this.request = request;
   this.objectId = objectId;
   this.oktemp = oktemp;
   this.objectAdapter = oa;
   this.connection = (com.sun.corba.se.spi.legacy.connection.Connection) request.getConnection();
 }
 /** The object which the client called to perform the operation. */
 public org.omg.CORBA.Object target() {
   // access is currently valid for all states:
   // checkAccess( MID_TARGET );
   if (cachedTargetObject == null) {
     CorbaContactInfo corbaContactInfo = (CorbaContactInfo) messageMediator.getContactInfo();
     cachedTargetObject = iorToObject(corbaContactInfo.getTargetIOR());
   }
   return cachedTargetObject;
 }
  /** See ServerRequestInfo for javadocs. */
  public org.omg.IOP.ServiceContext get_request_service_context(int id) {
    checkAccess(MID_GET_REQUEST_SERVICE_CONTEXT);

    if (cachedRequestServiceContexts == null) {
      cachedRequestServiceContexts = new HashMap();
    }

    return getServiceContext(cachedRequestServiceContexts, request.getRequestServiceContexts(), id);
  }
 /** See RequestInfoImpl for javadoc. */
 public int request_id() {
   // access is currently valid for all states:
   // checkAccess( MID_REQUEST_ID );
   /*
    * NOTE: The requestId in client interceptors is the same as the
    * GIOP request id.  This works because both interceptors and
    * request ids are scoped by the ORB on the client side.
    */
   return messageMediator.getRequestId();
 }
  /**
   * Allows interceptors to add service contexts to the request.
   *
   * <p>There is no declaration of the order of the service contexts. They may or may not appear in
   * the order they are added.
   */
  public void add_request_service_context(ServiceContext service_context, boolean replace) {
    checkAccess(MID_ADD_REQUEST_SERVICE_CONTEXT);

    if (cachedRequestServiceContexts == null) {
      cachedRequestServiceContexts = new HashMap();
    }

    addServiceContext(
        cachedRequestServiceContexts,
        messageMediator.getRequestServiceContexts(),
        service_context,
        replace);
  }
  /**
   * The profile that will be used to send the request. If a location forward has occurred for this
   * operation's object and that object's profile change accordingly, then this profile will be that
   * located profile.
   */
  public TaggedProfile effective_profile() {
    // access is currently valid for all states:
    // checkAccess( MID_EFFECTIVE_PROFILE );

    if (cachedEffectiveProfile == null) {
      CorbaContactInfo corbaContactInfo = (CorbaContactInfo) messageMediator.getContactInfo();
      cachedEffectiveProfile = corbaContactInfo.getEffectiveProfile().getIOPProfile();
    }

    // Good citizen: In the interest of efficiency, we assume interceptors
    // will not modify the returned TaggedProfile in any way so we need
    // not make a deep copy of it.

    return cachedEffectiveProfile;
  }
  /**
   * The actual object on which the operation will be invoked. If the reply_status is
   * LOCATION_FORWARD, then on subsequent requests, effective_target will contain the forwarded IOR
   * while target will remain unchanged.
   */
  public org.omg.CORBA.Object effective_target() {
    // access is currently valid for all states:
    // checkAccess( MID_EFFECTIVE_TARGET );

    // Note: This is not necessarily the same as locatedIOR.
    // Reason: See the way we handle COMM_FAILURES in
    // ClientRequestDispatcher.createRequest, v1.32

    if (cachedEffectiveTargetObject == null) {
      CorbaContactInfo corbaContactInfo = (CorbaContactInfo) messageMediator.getContactInfo();
      // REVISIT - get through chain like getLocatedIOR helper below.
      cachedEffectiveTargetObject = iorToObject(corbaContactInfo.getEffectiveTargetIOR());
    }
    return cachedEffectiveTargetObject;
  }
  /**
   * Returns all the tagged components with the given ID from the profile selected for this request.
   */
  public TaggedComponent[] get_effective_components(int id) {
    checkAccess(MID_GET_EFFECTIVE_COMPONENTS);
    Integer integerId = new Integer(id);
    TaggedComponent[] result = null;
    boolean justCreatedCache = false;

    if (cachedEffectiveComponents == null) {
      cachedEffectiveComponents = new HashMap();
      justCreatedCache = true;
    } else {
      // Look in cache:
      result = (TaggedComponent[]) cachedEffectiveComponents.get(integerId);
    }

    // null could mean we cached null or not in cache.
    if ((result == null)
        && (justCreatedCache || !cachedEffectiveComponents.containsKey(integerId))) {
      // Not in cache.  Get it from the profile:
      CorbaContactInfo corbaContactInfo = (CorbaContactInfo) messageMediator.getContactInfo();
      IIOPProfileTemplate ptemp =
          (IIOPProfileTemplate) corbaContactInfo.getEffectiveProfile().getTaggedProfileTemplate();
      result = ptemp.getIOPComponents(myORB, id);
      cachedEffectiveComponents.put(integerId, result);
    }

    // As per ptc/00-08-06, section 21.3.13.6., If not found, raise
    // BAD_PARAM with minor code INVALID_COMPONENT_ID.
    if ((result == null) || (result.length == 0)) {
      throw stdWrapper.invalidComponentId(integerId);
    }

    // Good citizen: In the interest of efficiency, we will assume
    // interceptors will not modify the returned TaggedCompoent[], or
    // the TaggedComponents inside of it.  Otherwise, we would need to
    // clone the array and make a deep copy of its contents.

    return result;
  }
  /** does not contain an etry for that ID, BAD_PARAM with a minor code of TBD_BP is raised. */
  public org.omg.IOP.ServiceContext get_reply_service_context(int id) {
    checkAccess(MID_GET_REPLY_SERVICE_CONTEXT);

    if (cachedReplyServiceContexts == null) {
      cachedReplyServiceContexts = new HashMap();
    }

    // In the event this is called from a oneway, we will have no
    // response object.
    //
    // In the event this is called after a IIOPConnection.purgeCalls,
    // we will have a response object, but that object will
    // not contain a header (which would hold the service context
    // container).  See bug 4624102.
    //
    // REVISIT: this is the only thing used
    // from response at this time.  However, a more general solution
    // would avoid accessing other parts of response's header.
    //
    // Instead of throwing a NullPointer, we will
    // "gracefully" handle these with a BAD_PARAM with minor code 25.

    try {
      ServiceContexts serviceContexts = messageMediator.getReplyServiceContexts();
      if (serviceContexts == null) {
        throw new NullPointerException();
      }
      return getServiceContext(cachedReplyServiceContexts, serviceContexts, id);
    } catch (NullPointerException e) {
      // REVISIT how this is programmed - not what it does.
      // See purge calls test.  The waiter is woken up by the
      // call to purge calls - but there is no reply containing
      // service contexts.
      throw stdWrapper.invalidServiceContextId(e);
    }
  }
 public com.sun.corba.se.spi.legacy.connection.Connection connection() {
   return (com.sun.corba.se.spi.legacy.connection.Connection) messageMediator.getConnection();
 }
 /** See RequestInfoImpl for javadoc. */
 public boolean response_expected() {
   // access is currently valid for all states:
   // checkAccess( MID_RESPONSE_EXPECTED );
   return !messageMediator.isOneWay();
 }
 /** See RequestInfoImpl for javadoc. */
 public String operation() {
   // access is currently valid for all states:
   // checkAccess( MID_OPERATION );
   return messageMediator.getOperationName();
 }
Exemplo n.º 15
0
 public static String operationNameAndRequestId(CorbaMessageMediator m) {
   return "op/" + m.getOperationName() + " id/" + m.getRequestId();
 }