Examples of IMethodDescription


Examples of com.sun.star.uno.IMethodDescription

    private boolean writeRequest(
        boolean internal, String oid, TypeDescription type, String function,
        ThreadId tid, Object[] arguments)
        throws IOException
    {
        IMethodDescription desc = type.getMethodDescription(function);
        synchronized (output) {
            if (desc.getIndex() == MethodDescription.ID_RELEASE
                && releaseQueue.size() < MAX_RELEASE_QUEUE_SIZE)
            {
                releaseQueue.add(
                    new QueuedRelease(internal, oid, type, desc, tid));
                return false;
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

            (currentContext && !internal
             && functionId != MethodDescription.ID_RELEASE)
            ? (XCurrentContext) unmarshal.readInterface(
                new Type(XCurrentContext.class))
            : null;
        IMethodDescription desc = inL1Type.getMethodDescription(functionId);
        ITypeDescription[] inSig = desc.getInSignature();
        ITypeDescription[] outSig = desc.getOutSignature();
        Object[] args = new Object[inSig.length];
        for (int i = 0; i < args.length; ++i) {
            if (inSig[i] != null) {
                if (outSig[i] != null) {
                    Object inout = Array.newInstance(
                        outSig[i].getComponentType().getZClass(), 1);
                    Array.set(
                        inout, 0,
                        unmarshal.readValue(
                            (TypeDescription) outSig[i].getComponentType()));
                    args[i] = inout;
                } else {
                    args[i] = unmarshal.readValue((TypeDescription) inSig[i]);
                }
            } else {
                args[i] = Array.newInstance(
                    outSig[i].getComponentType().getZClass(), 1);
            }
        }
        boolean sync = forcedSynchronous || !desc.isOneway();
        if (sync) {
            pendingIn.push(
                inL1Tid, new PendingRequests.Item(internal, desc, args));
        }
        return new UrpMessage(
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

    private boolean writeRequest(
        boolean internal, String oid, TypeDescription type, String function,
        ThreadId tid, Object[] arguments)
        throws IOException
    {
        IMethodDescription desc = type.getMethodDescription(function);
        synchronized (output) {
            if (desc.getIndex() == MethodDescription.ID_RELEASE
                && releaseQueue.size() < MAX_RELEASE_QUEUE_SIZE)
            {
                releaseQueue.add(
                    new QueuedRelease(internal, oid, type, desc, tid));
                return false;
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

                        prefix + "; getMethodDescriptions " + i,
                        i + methodOffset, mds[i]);
                }
            }
            for (int i = 0; i < methodNames.length; ++i) {
                IMethodDescription md = description.getMethodDescription(
                    i + methodOffset);
                assure(prefix + "; getMethodDescription " + (i + methodOffset),
                       md != null);
                methodSignatures[i].test(
                    prefix + "; getMethodDescription " + (i + methodOffset),
                    i + methodOffset, md);
            }
            for (int i = 0; i < methodNames.length; ++i) {
                IMethodDescription md = description.getMethodDescription(
                    methodNames[i]);
                assure(prefix + "; getMethodDescription " + methodNames[i],
                       md != null);
                methodSignatures[i].test(
                    prefix + "; getMethodDescription " + methodNames[i],
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

    public Object execute() throws Throwable {
        Object msgResult = _iMessage.getResult();
        if (_iMessage.isRequest()) {
            Object result = null;
            Throwable exception = null;
            IMethodDescription md = _iMessage.getMethod();
            Object[] args = _iMessage.getArguments();
            XCurrentContext oldCC = UnoRuntime.getCurrentContext();
            UnoRuntime.setCurrentContext(_iMessage.getCurrentContext());
            try {
                result = md.getIndex() == MethodDescription.ID_QUERY_INTERFACE
                    ? dispatch_queryInterface((Type) args[0])
                    : md.getMethod().invoke(_object, args);
            } catch (InvocationTargetException e) {
                exception = e.getTargetException();
                if (exception == null) {
                    exception = e;
                }
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

      methodId = _unmarshal.readbyte();

    if((header & NEWTYPE) != 0)
      _in_interface = _unmarshal.readTypeDescription();

    IMethodDescription iMethodDescription = _in_interface.getMethodDescription(methodId);

    if((header & MOREFLAGS) == 0) // no ex flags, so get info from typeinfo
      synchron[0] = !iMethodDescription.isOneway();

    if((header & NEWOID) != 0) // new oid?
      _in_oid = _unmarshal.readOid();
   
    if((header & NEWTID) != 0) // new thread id ?
      _in_threadId = _unmarshal.readThreadId();
   
    _ignore_cache = ((header & IGNORECACHE) != 0); // do not use cache for this request?
   
    operation[0] = iMethodDescription.getName();
   
    param[0] = readParams(iMethodDescription);

    if(synchron[0]) // if the request is synchron, the reply is pending
      putPendingReply(_in_threadId, new Object[]{param[0], iMethodDescription.getOutSignature(), iMethodDescription.getReturnSignature()/*, mMDesc*/});

    if(DEBUG) System.err.println("##### " + getClass().getName() + ".readLongRequest:" + _in_oid + " " + operation[0] + " " + synchron[0]);
  }
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

    if(DEBUG) System.err.println("##### " + getClass().getName() + ".writeRequest:" + oid + " " + zInterface + " " + operation);

    ++ _requestsSend;
    ++ _message_count;

    IMethodDescription iMethodDescription = zInterface.getMethodDescription(operation);
   
    byte header = 0;
    boolean bigHeader = false;
   
    if(_out_oid == null || !oid.equals(_out_oid)) { // change the oid?
      header |= NEWOID;
     
      _out_oid = oid;
      bigHeader = true;
    }
    else
      oid = null;
   
   
    if(_out_interface == null || !_out_interface.equals(zInterface)) { // change interface
      header |= NEWTYPE;
     
      _out_interface = zInterface;
      bigHeader = true;
    }
    else
      zInterface = null;
   
    if(_out_threadId == null || !_out_threadId.equals(threadId)) { // change thread id
      header |= NEWTID;
     
      _out_threadId = threadId;
     
      bigHeader = true;
    }
    else
      threadId = null;
   
    boolean hasExFlags = false;
   
    // if synchron is provided, test if it differs from declaration
    if(synchron[0] != null) {
      if(iMethodDescription.isOneway() == synchron[0].booleanValue()) {
        bigHeader = true;
        hasExFlags = true;
      }
    }
    else
      synchron[0] = new Boolean(!iMethodDescription.isOneway());
   
    // if mustReply is provided and if it differs from synchron
    // then we have to write it
    if(mustReply[0] != null && (mustReply[0] != synchron[0])) {
      bigHeader = true;
      hasExFlags = true;
    }
    else
      mustReply[0] = synchron[0];
   
    if(bigHeader) { // something has changed, send big header
      header |= BIG_HEADER; // big header
      header |= REQUEST;
      header |= hasExFlags ? MOREFLAGS : 0;
     
      if(iMethodDescription.getIndex() > 255)
        header |= LONGMETHODID;
     
      _marshal.writebyte(header);
     
      if(hasExFlags) {// are there extended flags to write?
        byte exFlags = 0;
       
        exFlags |= synchron[0].booleanValue() ? SYNCHRONOUSE : 0;
        exFlags |= mustReply[0].booleanValue() ? MUSTREPLY : 0;
       
        _marshal.writebyte(exFlags);
      }
     
      // write the method id
      if(iMethodDescription.getIndex() > 255)
        _marshal.writeshort((short)iMethodDescription.getIndex());
      else
        _marshal.writebyte((byte)iMethodDescription.getIndex());
     
      if(zInterface != null) // has the interface changed? -> write it
        _marshal.writeTypeDescrption(zInterface);
     
      if(oid != null) // has the oid changed? -> write it
        _marshal.writeOid(_out_oid);
     
      if(threadId != null) // has the thread id changed? -> write it
        _marshal.writeThreadId(threadId);
    }
    else { // simple request
      if(iMethodDescription.getIndex() <= 0x2f) // does the method id fit in the header?
        _marshal.writebyte((byte)iMethodDescription.getIndex());
      else { // no
        header |= DIR_MID;
        header |= iMethodDescription.getIndex() >> 8;
       
        _marshal.writebyte(header);
        _marshal.writebyte((byte)(iMethodDescription.getIndex() & 0xff));
      }
    }
   
    // write the in parameters
    ITypeDescription in_sig[] = iMethodDescription.getInSignature();
    ITypeDescription out_sig[] = iMethodDescription.getOutSignature();
    for(int i = 0; i < in_sig.length; ++ i) {
      if(in_sig[i] != null) { // is it an in parameter?
        if(out_sig[i] != null// is it also an out parameter?
          _marshal.writeObject(out_sig[i].getComponentType(), ((Object [])params[i])[0]);
        else // in only
          _marshal.writeObject(in_sig[i], params[i]);
      }
    }
   
    if(synchron[0].booleanValue()) // if we are waiting for a reply, the reply is pending
      putPendingRequest(_out_threadId, new Object[]{params, out_sig, iMethodDescription.getReturnSignature()});
  }
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

    System.err.println("TypeClass:" + iTypeDescription.getTypeClass());
    System.err.println("ComponentType:" + iTypeDescription.getComponentType());
    System.err.println("Class:" + iTypeDescription.getZClass());
   
    System.err.println("Methods:");
    IMethodDescription iMethodDescriptions[] = iTypeDescription.getMethodDescriptions();
    if(iMethodDescriptions != null)
      for(int i = 0; i < iMethodDescriptions.length; ++ i) {
        System.err.print("Name: " + iMethodDescriptions[i].getName());
        System.err.print(" index: " + iMethodDescriptions[i].getIndex());
        System.err.print(" isOneyWay: " + iMethodDescriptions[i].isOneway());
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

    if((header & DIR_MID) != 0)
      methodId = (((header & 0x3f) << 8) | _unmarshal.readbyte()) & 0x3fff;
    else
      methodId = (header & 0x3f);

    IMethodDescription iMethodDescription = _in_interface.getMethodDescription(methodId);
    operation[0] = iMethodDescription.getName();

    synchron[0] = !iMethodDescription.isOneway();

    param[0] = readParams(iMethodDescription);
   
    if(synchron[0]) { // if the request is synchron, it is pending
      putPendingReply(_in_threadId, new Object[]{param[0], iMethodDescription.getOutSignature(), iMethodDescription.getReturnSignature()/*, mMDesc*/});
    }

    if(DEBUG) System.err.println("##### " + getClass().getName() + ".readShortRequest:" + _in_oid + " " + operation[0] + " " + synchron[0]);
  }
View Full Code Here

Examples of com.sun.star.uno.IMethodDescription

  public IMethodDescription getMethodDescription(int methodId) {
    if(_methodDescriptionsByName == null)
      _initMethodTypeInfos();

    IMethodDescription iMethodDescription = null;

    int relMethodId = methodId - (_offset - _methodDescriptions.length);

    if(relMethodId >= 0 && relMethodId < _methodDescriptions.length)
      iMethodDescription = _methodDescriptions[relMethodId];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.