Package java.rmi.activation

Examples of java.rmi.activation.ActivateFailedException


    } catch (UnsupportedOperationException uoe) {
    }
      }
      Object newProxy = id.activate(force);
      if (!Proxy.isProxyClass(newProxy.getClass())) {
    throw new ActivateFailedException("invalid proxy");
      }
     
      InvocationHandler obj = Proxy.getInvocationHandler(newProxy);
      if (!(obj instanceof ActivatableInvocationHandler)) {
    throw new ActivateFailedException("invalid proxy handler");
      }
      ActivatableInvocationHandler handler =
    (ActivatableInvocationHandler) obj;
      if (!id.equals(handler.id)) {
    throw new ActivateFailedException("unexpected activation id");
      }
     
      Remote newUproxy = handler.uproxy;
      if (newUproxy == null) {
    throw new ActivateFailedException("null underlying proxy");
      } else if (newUproxy instanceof RemoteMethodControl) {
    newUproxy = (Remote) ((RemoteMethodControl) newUproxy).
            setConstraints(clientConstraints);
      }
      uproxy = newUproxy;
     
  } catch (ConnectException e) {
      throw new ConnectException("activation failed", e);
  } catch (RemoteException e) {
      throw new ConnectIOException("activation failed", e);
  } catch (UnknownObjectException e) {
      throw new NoSuchObjectException("object not registered");
  } catch (ActivationException e) {
      throw new ActivateFailedException("activation failed", e);
  }
    }
View Full Code Here


    /**
     * Test method for {@link java.rmi.activation.ActivateFailedException#ActivateFailedException(java.lang.String, java.lang.Exception)}.
     */
    public void testActivateFailedExceptionStringException() {
        NullPointerException npe = new NullPointerException("npe");
        ActivateFailedException e = new ActivateFailedException("fixture", npe);
        assertTrue(e.getMessage().contains("fixture"));
        assertSame(npe, e.getCause());
    }
View Full Code Here

    /**
     * Test method for {@link java.rmi.activation.ActivateFailedException#ActivateFailedException(java.lang.String)}.
     */
    public void testActivateFailedExceptionString() {
        ActivateFailedException e = new ActivateFailedException("fixture");
        assertEquals("fixture", e.getMessage());
        assertNull(e.getCause());
    }
View Full Code Here

    Modifier.isPublic(cl.getModifiers()))
      {
    try {
        m = cl.getMethod(m.getName(), m.getParameterTypes());
    } catch (NoSuchMethodException nsme) {
        throw new ActivateFailedException("bad proxy").
      initCause(nsme);
    }
      }
  }

  try {
      return m.invoke(proxy, args);
  } catch (IllegalAccessException e) {
      throw new ActivateFailedException("bad proxy").initCause(e);
  } catch (IllegalArgumentException e) {
      throw new ActivateFailedException("bad proxy").initCause(e);
  } catch (InvocationTargetException e) {
      throw e.getTargetException();
  }
    }
View Full Code Here

    } catch (UnsupportedOperationException uoe) {
    }
      }
      Object newProxy = id.activate(force);
      if (!Proxy.isProxyClass(newProxy.getClass())) {
    throw new ActivateFailedException("invalid proxy");
      }
     
      InvocationHandler obj = Proxy.getInvocationHandler(newProxy);
      if (!(obj instanceof ActivatableInvocationHandler)) {
    throw new ActivateFailedException("invalid proxy handler");
      }
      ActivatableInvocationHandler handler =
    (ActivatableInvocationHandler) obj;
      if (!id.equals(handler.id)) {
    throw new ActivateFailedException("unexpected activation id");
      }
     
      Remote newUproxy = handler.uproxy;
      if (newUproxy == null) {
    throw new ActivateFailedException("null underlying proxy");
      } else if (newUproxy instanceof RemoteMethodControl) {
    newUproxy = (Remote) ((RemoteMethodControl) newUproxy).
            setConstraints(clientConstraints);
      }
      uproxy = newUproxy;
     
  } catch (ConnectException e) {
      throw new ConnectException("activation failed", e);
  } catch (RemoteException e) {
      throw new ConnectIOException("activation failed", e);
  } catch (UnknownObjectException e) {
      throw new NoSuchObjectException("object not registered");
  } catch (ActivationException e) {
      throw new ActivateFailedException("activation failed", e);
  }
    }
View Full Code Here

TOP

Related Classes of java.rmi.activation.ActivateFailedException

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.