home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 4.0 KB | 129 lines |
- /*
- * @(#)ActivationGroupDesc.java 1.7 98/03/18
- *
- * Copyright 1997, 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.rmi.activation;
-
- import java.io.IOException;
- import java.rmi.MarshalledObject;
- import java.security.CodeSource;
- import java.util.Properties;
-
-
- /**
- * An activation group descriptor contains the information necessary to
- * create/recreate an activation group in which to activate objects.
- * Such a descriptor contains: <ul>
- * <li> the group's class name,
- * <li> the group's code source (the location of the group's class), and
- * <li> a "marshalled" object that can contain group specific
- * initialization data. </ul> <p>
- *
- * The group's class must be a concrete subclass of
- * <code>ActivationGroup</code>. A subclass of
- * <code>ActivationGroup</code> is created/recreated via the
- * <code>ActivationGroup.createGroup</code> static method that invokes
- * a special constructor that takes two arguments: <ul>
- *
- * <li> the group's <code>ActivationGroupID</code>, and
- * <li> the group's initialization data (in a
- * <code>java.rmi.MarshalledObject</code>)</ul><p>
- *
- * @version 1.7, 03/18/98
- * @author Ann Wollrath
- * @since JDK1.2
- * @see ActivationGroup
- * @see ActivationGroupID
- */
- public final class ActivationGroupDesc implements java.io.Serializable
- {
- private String className;
- private CodeSource source;
- private MarshalledObject data;
- /** indicate compatibility with JDK 1.2 version of class */
- private static final long serialVersionUID = -4936225423168276595L;
-
- /**
- * Constructs a group descriptor that uses system default for
- * group implementation and code source. Properties specify
- * environment. The additional property
- * <code>java.rmi.activation.security.class</code> and
- * <code>java.rmi.activation.security.codebase</code> specifies
- * (respectively) the class name of the security manager, and the
- * codebase, the location, of the class. If former property is not
- * set, then the <code>java.rmi.RMISecurityManager</code> will be
- * used as the security manager for group.
- *
- * @param properties the set of properties to set when the group
- * is recreated
- * @exception IllegalArgumentException if <code>properties</code> is null
- * @exception IOException if a <code>MarshalledObject</code> could
- * not be created from the properties
- */
- public ActivationGroupDesc(Properties properties)
- throws IOException
- {
- if (properties == null)
- throw new IllegalArgumentException("properties can't be null");
-
- this.data = new MarshalledObject(properties);
- this.className = "sun.rmi.server.ActivationGroupImpl";
- }
-
- /**
- * Specifies an alternate group implementation to be
- * used for the group.
- *
- * @param className the group's fully package qualified className
- * @param source the CodeSource from where to load the group's class
- * @param data the group's initialization data contained in
- * marshalled form (could contain properties, for example)
- */
- public ActivationGroupDesc(String className,
- CodeSource source,
- MarshalledObject data)
- {
- this.className = className;
- this.source = source;
- this.data = data;
- }
-
- /**
- * Returns the group's class name.
- * @return the group's class name
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Returns the group's code source.
- * @return the group's code source
- */
- public CodeSource getCodeSource()
- {
- return source;
- }
-
- /**
- * Returns the group's initialization data.
- * @return the group's initialization data
- */
- public MarshalledObject getData()
- {
- return data;
- }
- }
-
-