Package com.sun.star.lib.uno.environments.remote

Examples of com.sun.star.lib.uno.environments.remote.IMessage


      Throwable throwable = null;

      try {
        do {
          // Use the protocol to read a job.
          IMessage iMessage = _iProtocol.readMessage(_inputStream);
         
         
          if(iMessage.getThreadId().equals(_threadId)) {
            continue;
          }
         
          // Take care of special methods release and acquire
                    String operation = iMessage.getOperation();
                    String oid = iMessage.getOid();
          if(operation != null && operation.equals("release")) {
                        Type interfaceType = new Type(iMessage.getInterface());
            _java_environment.revokeInterface(oid, interfaceType );
            remRefHolder(interfaceType, oid);
           
            if(iMessage.mustReply())
              sendReply(false, iMessage.getThreadId(), null);
          }
          else if(operation != null && operation.equals("acquire")) {
                        Type interfaceType = new Type(iMessage.getInterface());
            String oid_o[] = new String[]{oid};
            _java_environment.registerInterface(null, oid_o, interfaceType );
           
            addRefHolder(null, interfaceType, oid);
          }
          else {
            Object object = null;
           
            if(operation != null) { // is it a request
                            Type interfaceType = new Type(iMessage.getInterface());
              object = _java_environment.getRegisteredInterface(oid, interfaceType);
             
              Object xexception = null;
             
              if(object == null) { // this is an unknown oid, so we may have to ask the XInstanceProvider
                if(_xInstanceProvider == null) // we have neither an object nor an instance provider -> exception
                  xexception = new com.sun.star.uno.RuntimeException(getClass().getName() + ".dispatch - no instance provider set and unknown object:" + oid);
               
                else {
                  try {
                    object = _xInstanceProvider.getInstance(oid);
                   
                    if(object == null && !operation.equals("queryInterface"))
                      xexception = new com.sun.star.uno.RuntimeException(
                        getClass().getName()
                        + ".dispatch: instance provider returned null and operation >"
                        + operation
                        + "< not supported on null");
                  }
                  catch(com.sun.star.container.NoSuchElementException noSuchElementException) {
                    xexception = new com.sun.star.uno.RuntimeException(getClass().getName() + ".dispatch - wrapped exception:" + noSuchElementException);
                  }
                  catch(com.sun.star.uno.RuntimeException runtimeException) {
                    xexception = runtimeException;
                  }
                }
              }
             
              if(xexception != null) {
                // an exception occurred while trying to get an instance.
                // propagate it.
                sendReply(true, iMessage.getThreadId(), xexception);
                iMessage = null;
              }
            }           
           
            if(iMessage != null) {
View Full Code Here


    Object params[] = new Object[methodDescription.getInSignature().length];

    if(synchron) // if the request is synchron, it is pending
      putPendingReply(threadId, new Object[]{params, methodDescription.getOutSignature(), methodDescription.getReturnSig(), new Integer(requestHeader.request_id)});
   
    IMessage iMessage = new Message(objectKey.sOid.theString,
                    null,
                    typeDescription,
                    methodDescription,
                    requestHeader.operation.theString,
                    threadId,
View Full Code Here

    LogicalThreadID logicalThreadID = unmarshalLogicalThreadID(unmarshal.isLittleEndian(), replyHeader.service_context[0].context_data);
   
    ThreadID threadId = new ThreadID(logicalThreadID.IDs[0].threadID);

    Object data[] = (Object[])removePendingRequest(threadId);
    IMessage iMessage = new Message(null,               // oid
                    null,               // object
                    null,               // interface
                    (MethodDescription)data[1],    // MMDesc
                    null,               // operation
                    threadId,
View Full Code Here

    boolean littleEndian = messageHeader.flags != 0;

    Unmarshal unmarshal = new Unmarshal(bytes, messageHeader.message_size, littleEndian, _iBridge);

    IMessage iMessage = null;

    switch(messageHeader.message_type) {
    case MsgType_1_1.Request_value:          iMessage = readRequest(unmarshal); break;
    case MsgType_1_1.Reply_value:           iMessage = readReply(unmarshal); break;
    case MsgType_1_1.MessageError_value:    throw new RuntimeException("WARNING: iiop - recieved a message error!!!");
View Full Code Here

   * @return  thread read job.
   * @see     com.sun.star.lib.uno.environments.remote.Job
   * @see                  com.sun.star.lib.uno.environments.remote.IProtocol#readJob
   */
  public IMessage readMessage(InputStream inputStream) throws IOException {
    IMessage iMessage = null;

        DataInput dataInput = new DataInputStream( inputStream );
      while(iMessage == null) { // try hard to get a message
      if(_unmarshal.bytesLeft() <= 0) { // the last block is empty, get a new one
        byte bytes[] = readBlock(dataInput);
View Full Code Here

TOP

Related Classes of com.sun.star.lib.uno.environments.remote.IMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.