Package java.rmi.activation

Examples of java.rmi.activation.ActivationException


            } catch (InvocationTargetException e) {
                Throwable targetException = e.getTargetException();
                if (targetException instanceof SecurityException) {
                    throw (SecurityException) targetException;
                } else {
                    throw new ActivationException(
                        execPolicyMethod.getName() + ": unexpected exception",
                        e);
                }
            } catch (Exception e) {
                throw new ActivationException(
                    execPolicyMethod.getName() + ": unexpected exception", e);
            }
        }
    }
View Full Code Here


                    system.shutdown();
                } catch (RemoteException ignore) {
                    // can't happen
                }
                // warn the client of the original update problem
                throw new ActivationException("log snapshot failed", e);
            }
        }
    }
View Full Code Here

        {
            checkShutdown();
            RegistryImpl.checkAccess("ActivationSystem.setActivationDesc");

            if (!getGroupID(id).equals(desc.getGroupID())) {
                throw new ActivationException(
                    "ActivationDesc contains wrong group");
            }
            return getGroupEntry(id).setActivationDesc(id, desc, true);
        }
View Full Code Here

    /**
     * Test method for {@link java.rmi.activation.ActivationException#ActivationException(java.lang.String, java.lang.Throwable)}.
     */
    public void testActivationExceptionStringThrowable() {
        NullPointerException npe = new NullPointerException("npe");
        ActivationException e = new ActivationException("fixture", npe);
        assertTrue(e.getMessage().contains("fixture"));
        assertSame(npe, e.getCause());
        assertSame(npe, e.detail);
        try {
            e.initCause(new NullPointerException());
            fail("did not throw illegal state exception");
        } catch (IllegalStateException ise) {
        }
    }
View Full Code Here

    /**
     * Test method for {@link java.rmi.activation.ActivationException#ActivationException(java.lang.String)}.
     */
    public void testActivationExceptionString() {
        ActivationException e = new ActivationException("fixture");
        assertTrue(e.getMessage().contains("fixture"));
        assertNull(e.getCause());
        assertNull(e.detail);
        try {
            e.initCause(new NullPointerException());
            fail("did not throw illegal state exception");
        } catch (IllegalStateException ise) {
        }
    }
View Full Code Here

    /**
     * Test method for {@link java.rmi.activation.ActivationException#ActivationException()}.
     */
    public void testActivationException() {
        ActivationException e = new ActivationException();
        assertNull(e.getMessage());
        assertNull(e.getCause());
        assertNull(e.detail);
        try {
            e.initCause(new NullPointerException());
            fail("did not throw illegal state exception");
        } catch (IllegalStateException ise) {
        }
    }
View Full Code Here

        /* start an activatable lookup service simulation */
        if (lookupServiceID == null) {
            lookupServiceID = lookupProxy.getServiceID();
        }
        if( (lookupProxy == null) || (lookupServiceID == null) ) {
            throw new ActivationException("failure creating lookup service");
        }
  // the code block was a noop for unicastPort > 0, because
  // setUnicastPort does nothing if the argument is unicastPort
//          if(unicastPort > 0) {
//              /* Change the locator port for this lookup service. */
 
View Full Code Here

                final ActivationGroupDesc desc,
                final long incarnation)
        throws ActivationException
    {
  if (state != UNUSED) {
      throw new ActivationException("group previously created");
  }
  try {
      final Configuration config = getConfiguration(desc.getData());
      login = (LoginContext) config.getEntry(
      PHOENIX, "loginContext", LoginContext.class, null);
      if (login != null) {
    login.login();
      }
   
      inheritGroupSubject =
    ((Boolean) config.getEntry(
        PHOENIX, "inheritGroupSubject", boolean.class,
        Boolean.FALSE)).booleanValue();
     
      return (java.rmi.activation.ActivationGroup) doAction(
    new PrivilegedExceptionAction() {
        public Object run() throws Exception {
      ProxyPreparer sysPreparer =
          getPreparer(config, "systemPreparer");
      monPreparer = getPreparer(config,
              "monitorPreparer");
      TcpServerEndpoint se =
          TcpServerEndpoint.getInstance(0);
      Exporter defaultExporter =
          new BasicJeriExporter(se, new AccessILFactory());
      exporter = (Exporter) config.getEntry(
        PHOENIX, "instantiatorExporter",
        Exporter.class, defaultExporter);
      if (exporter == null) {
          exporter = new AlreadyExportedExporter();
      }
      refuseCalls =
          !(exporter instanceof AlreadyExportedExporter);
      unexportTimeout = getInt(config, "unexportTimeout",
             60000);
      unexportWait = getInt(config, "unexportWait", 10);
      ActivationSystem sys = (ActivationSystem)
          sysPreparer.prepareProxy(id.getSystem());
      ActivationGroupImpl.incarnation = incarnation;
      groupID = id;
      state = CREATING;
      ActivationGroupID gid = (sys == id.getSystem() ?
             id : new WrappedGID(id, sys));
      Object group = ActivationGroup.createGroup(
                gid, desc, incarnation);
      state = ACTIVE;
      return group;
        }
    });
  } catch (ActivationException e) {
      throw e;
  } catch (Exception e) {
      throw new ActivationException("creation failed", e);
  } finally {
      if (state != ACTIVE) {
    checkInactiveGroup();
      }
  }
View Full Code Here

  throws ActivationException, RemoteException
    {
  super(id);
  synchronized (ActivationGroupImpl.class) {
      if (state != CREATING) {
    throw new ActivationException("not called from createGroup");
      }
  }
  if (refuseCalls) {
      unexportObject(this, true);
      refuseCalls = false;
View Full Code Here

    active.put(id, entry);
      }
      return entry.mobj;
  } catch (NoSuchMethodException e) {
      /* user forgot to provide activatable constructor? */
      throw new ActivationException(
    "activation constructor not defined", e);
  } catch (NoSuchMethodError e) {
      /* code recompiled and user forgot to provide
       *  activatable constructor?
       */
      throw new ActivationException(
    "activation constructor not defined", e);
  } catch (InvocationTargetException e) {
      throw new ActivationException("exception constructing object",
            e.getTargetException());
  } catch (ActivationException e) {
      throw e;
  } catch (Exception e) {
      throw new ActivationException("unable to activate object", e);
  } finally {
      releaseLock(id);
      checkInactiveGroup();
  }
    }
View Full Code Here

TOP

Related Classes of java.rmi.activation.ActivationException

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.