Package com.sun.star.lang

Examples of com.sun.star.lang.DisposedException


                    }
                    _iThreadPool.putJob(
                        new Job(obj, java_remote_bridge.this, msg));
                }
            } catch (Throwable e) {
                dispose(new DisposedException(e.toString()));
            }
        }
View Full Code Here


   * @param      object     the object to map
   * @param      type       the interface under which is to be mapped
   * @see                   com.sun.star.uno.IBridge#mapInterfaceTo
   */
  public Object mapInterfaceTo(Object object, Type type) {
    if(_disposed) throw new DisposedException(
            "java_remote_bridge(" + this + ").mapInterfaceTo - is disposed");

    String oid[] = new String[1];

    // if object is a string, than it is already mapped as a virtuell proxy
View Full Code Here

   * @param      object     the object to map
   * @param      type       the interface under which is to be mapped
   * @see                   com.sun.star.uno.IBridge#mapInterfaceFrom
   */
  public Object mapInterfaceFrom(Object oId, Type type) {
    if(_disposed) throw new DisposedException(
            "java_remote_bridge(" + this + ").mapInterfaceFrom - is disposed");

    acquire();

    // see if we already have object with zInterface of given oid
View Full Code Here

  }

  private synchronized void dispose(Throwable throwable) {
    if(DEBUG) System.err.println("##### " + getClass().getName() + ".dispose - life count:" + _life_count);

    if(_disposed) throw new DisposedException("java_remote_bridge(" + this + ").dispose - is disposed");

    if(!_disposing) {
      _disposing = true;

      notifyListeners();
View Full Code Here


  public void sendReply(boolean exception, ThreadId threadId, Object result) {
    if(DEBUG) System.err.println("##### " + getClass().getName() + ".sendReply:" + exception + " " + result);

    if(_disposed) throw new DisposedException(
            "java_remote_bridge(" + this + ").sendReply - is disposed");

    synchronized(_outputStream) {
      _iProtocol.writeReply(exception, threadId, result);
      try {
        _iProtocol.flush(new DataOutputStream(_outputStream));
        _outputStream.flush();
      }
      catch(IOException iOException) {
                DisposedException disposedException = new DisposedException(
                    getClass().getName() + ".sendReply - unexpected:" + iOException);
        dispose(disposedException);

        throw disposedException;
      }
View Full Code Here

      synchron = new Boolean[1];

    if(mustReply == null)
      mustReply = new Boolean[1];

    if(_disposed) throw new DisposedException(
            "java_remote_bridge(" + this + ").sendRequest - is disposed");

    if(operation.equals("acquire")) acquire()// keep this bridge alife

    boolean goThroughThreadPool = false;

    try {
      synchronized(_outputStream) {
        _iProtocol.writeRequest((String)object, TypeDescription.getTypeDescription(type), operation, ThreadPoolFactory.getThreadId(), params, synchron, mustReply);

        goThroughThreadPool = synchron[0].booleanValue()  && Thread.currentThread() != _messageDispatcher;

        if(goThroughThreadPool) // prepare a queue for this thread in the threadpool
          _iThreadPool.attach();

        try {
          _iProtocol.flush(new DataOutputStream(_outputStream));
          _outputStream.flush();
        }
        catch(IOException iOException) {
                    DisposedException disposedException =
                        new DisposedException( iOException.getMessage() );
          dispose(disposedException);
                    throw disposedException;
        }
      }
View Full Code Here

        if(!_quit && DEBUG) {
          System.err.println(getClass() + " - reading message - exception occurred: \"" + eofException + "\"");
          System.err.println(getClass() + " - giving up");
        }

        throwable = new DisposedException( eofException.getMessage() );
      }
      catch(Exception exception) {
        if(DEBUG) {
          System.err.println(getClass() + " - reading message - exception occurred: \"" + exception + "\"");
          exception.printStackTrace();
          System.err.println(getClass() + " - giving up");
        }
          if(DEBUG)
          exception.printStackTrace();

        throwable = new DisposedException( exception.getMessage() );
      }

      // dispose this bridge only within an error
      if(!_quit && !java_remote_bridge.this._disposed)
        java_remote_bridge.this.dispose(throwable);
View Full Code Here

        else
            bVoidValue= value == null;
        if (bVoidValue && (prop.Attributes & PropertyAttribute.MAYBEVOID) == 0)
            throw new com.sun.star.lang.IllegalArgumentException("The property must have a value; the MAYBEVOID attribute is not set!");
        if (bInDispose || bDisposed)
            throw new DisposedException("Component is already disposed");
       
        //Check if the argument is allowed
        boolean bValueOk= false;
        if (value instanceof Any)
            bValueOk= checkType(((Any) value).getObject());
View Full Code Here

        Property p = ((PropertyData) properties.get(propertyName)).property;
        Vector specificVeto = null;
        Vector unspecificVeto = null;
        synchronized (this) {
            if (disposed) {
                throw new DisposedException("disposed", object);
            }
            if ((p.Attributes & PropertyAttribute.CONSTRAINED) != 0) {
                Object o = vetoListeners.get(propertyName);
                if (o != null) {
                    specificVeto = (Vector) ((Vector) o).clone();
View Full Code Here

        try {
            _iProtocol.writeReply(exception, threadId, result);
        } catch (IOException e) {
            dispose(e);
            throw new DisposedException("unexpected " + e);
        } catch (RuntimeException e) {
            dispose(e);
            throw e;
        } catch (Error e) {
            dispose(e);
View Full Code Here

TOP

Related Classes of com.sun.star.lang.DisposedException

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.