📄 genericpeergroup.html
字号:
<A NAME="loadModule(net.jxta.id.ID, net.jxta.document.Advertisement, boolean)"><!-- --></A><H3>loadModule</H3><PRE>protected <A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A> <B>loadModule</B>(<A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A> assigned, <A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> impl, boolean privileged) throws <A HREF="../../../../net/jxta/exception/ProtocolNotSupportedException.html" title="class in net.jxta.exception">ProtocolNotSupportedException</A>, <A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></PRE><DL><DD>Internal version, allows one to make a privileged module (has a ref to the true group obj instead of just an interface. That's for group modules and main apps normally).<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../../net/jxta/exception/ProtocolNotSupportedException.html" title="class in net.jxta.exception">ProtocolNotSupportedException</A></CODE><DD><CODE><A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></CODE></DL></DD></DL><HR><A NAME="loadModule(net.jxta.id.ID, net.jxta.platform.ModuleSpecID, int)"><!-- --></A><H3>loadModule</H3><PRE>public <A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A> <B>loadModule</B>(<A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A> assigned, <A HREF="../../../../net/jxta/platform/ModuleSpecID.html" title="class in net.jxta.platform">ModuleSpecID</A> specID, int where)</PRE><DL><DD>Load a module from a spec id. Advertisement is sought, compatibility is checked on all candidates and load is attempted. The first one that is compatible and loads successfuly is init()ed and returned.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/peergroup/PeerGroup.html#loadModule(net.jxta.id.ID, net.jxta.platform.ModuleSpecID, int)">loadModule</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>assigned</CODE> - Id to be assigned to that module (usually its ClassID).<DD><CODE>specID</CODE> - The specID of this module.<DD><CODE>where</CODE> - May be one of: Here, FromParent, or Both, meaning that the implementation advertisement will be searched in this group, its parent or both. As a general guideline, the implementation advertisements of a group should be searched in its propsective parent (that is Here), the implementation advertisements of a group standard service should be searched in the same group than where this group's advertisement was found (that is, FromParent), while applications may be sought more freely (Both).<DT><B>Returns:</B><DD>Module the new module, or null if no usuable implementation was found.</DL></DD></DL><HR><A NAME="loadModule(net.jxta.id.ID, net.jxta.platform.ModuleSpecID, int, boolean)"><!-- --></A><H3>loadModule</H3><PRE>protected <A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A> <B>loadModule</B>(<A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A> assigned, <A HREF="../../../../net/jxta/platform/ModuleSpecID.html" title="class in net.jxta.platform">ModuleSpecID</A> specID, int where, boolean privileged)</PRE><DL><DD>Load a module from a spec id. Advertisement is sought, compatibility is checked on all candidates and load is attempted. The first one that is compatible and loads successfuly is init()ed and returned.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getConfigAdvertisement()"><!-- --></A><H3>getConfigAdvertisement</H3><PRE>public <A HREF="../../../../net/jxta/protocol/ConfigParams.html" title="class in net.jxta.protocol">ConfigParams</A> <B>getConfigAdvertisement</B>()</PRE><DL><DD>Returns the config advertisment for this peer in this group (if any).<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/peergroup/PeerGroup.html#getConfigAdvertisement()">getConfigAdvertisement</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>The advertisement or <code>null</code> if none is available.</DL></DD></DL><HR><A NAME="setConfigAdvertisement(net.jxta.protocol.ConfigParams)"><!-- --></A><H3>setConfigAdvertisement</H3><PRE>protected void <B>setConfigAdvertisement</B>(<A HREF="../../../../net/jxta/protocol/ConfigParams.html" title="class in net.jxta.protocol">ConfigParams</A> config)</PRE><DL><DD>{@inheritDoc}<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="init(net.jxta.peergroup.PeerGroup, net.jxta.id.ID, net.jxta.document.Advertisement)"><!-- --></A><H3>init</H3><PRE>public void <B>init</B>(<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> homeGroup, <A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A> assignedID, <A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> impl) throws <A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></PRE><DL><DD>Initialize the module, passing it its peer group and advertisement. <p/>Note: when subclassing one of the existing PeerGroup implementations (which implement Module), it may not be recommended to overload the init method. See the documentation of the PeerGroup class being subclassed. <p/>It is not recommended to overload this method. Instead, subclassers should overload either or both of <A HREF="../../../../net/jxta/impl/peergroup/GenericPeerGroup.html#initFirst(net.jxta.peergroup.PeerGroup, net.jxta.id.ID, net.jxta.document.Advertisement)"><CODE>initFirst(PeerGroup,ID,Advertisement)</CODE></A> and <A HREF="../../../../net/jxta/impl/peergroup/GenericPeerGroup.html#initLast()"><CODE>initLast()</CODE></A>. If this method is to be overloaded, the overloading method must invoke <code>super.init</code>. <p/>This method invokes <code>initFirst</code> with identical parameters. <code>initLast</initLast> does not take parameters since the relevant information can be obtained from the group following completion of the <code>initFirst</code> phase. The resulting values may be different from the parameters to <code>initFirst</code> since <code>initFirst</code> may be overLoaded and the overloading method may modify these parameters when calling <code>super.initFirst</code>. (See <CODE>net.jxta.impl.Platform</CODE> for an example of such a case). <p/>Upon completion, the group object is marked as completely initialized in all cases. Once a group object is completely initialized, it becomes sensitive to reference counting. <p/>In the future this method may become final.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/platform/Module.html#init(net.jxta.peergroup.PeerGroup, net.jxta.id.ID, net.jxta.document.Advertisement)">init</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>homeGroup</CODE> - The PeerGroup from which this Module can obtain services. If this module is a service, this is also the PeerGroup of which this module is a service.<DD><CODE>assignedID</CODE> - Identity of Module within group. modules can use it as a the root of their namespace to create names that are unique within the group but predictible by the same module on another peer. This is normaly the ModuleClassID which is also the name under which the module is known by other modules. For a group it is the PeerGroupID itself. The parameters of a service, in the Peer configuration, are indexed by the assignedID of that service, and a Service must publish its run-time parameters in the Peer Advertisement under its assigned ID.<DD><CODE>impl</CODE> - The implementation advertisement for this Module. It is permissible to pass null if no implementation advertisement is available. This may happen if the implementation was selected by explicit class name rather than by following an implementation advertisement. Modules are not required to support that style of loading, but if they do, then their documentation should mention it.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></CODE> - This module failed to initialize.</DL></DD></DL><HR><A NAME="initFirst(net.jxta.peergroup.PeerGroup, net.jxta.id.ID, net.jxta.document.Advertisement)"><!-- --></A><H3>initFirst</H3><PRE>protected void <B>initFirst</B>(<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A> homeGroup, <A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A> assignedID, <A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> impl) throws <A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></PRE><DL><DD>Performs all initialization steps that need to be performed before any subclass initialization is performed. <p/>Classes that override this method should always call <code>super.initFirst()</code> <strong>before</strong> doing any of their own work.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>homeGroup</CODE> - The group that serves as a parent to this group.<DD><CODE>assignedID</CODE> - The unique ID assigned to this module. For group this is the group ID or <code>null</code> if a group ID has not yet been assigned. If null is passed, GenericPeerGroup choses a new group ID.<DD><CODE>impl</CODE> - The ModuleImplAdvertisement which defines this group's implementation.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></CODE></DL></DD></DL><HR><A NAME="initLast()"><!-- --></A><H3>initLast</H3><PRE>protected void <B>initLast</B>() throws <A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></PRE><DL><DD>Perform all initialization steps that need to be performed after any subclass initialization is performed. <p/>Classes that override this method should always call super.initLast <strong>after</strong> doing any of their own work.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></CODE></DL></DD></DL><HR><A NAME="startApp(java.lang.String[])"><!-- --></A><H3>startApp</H3><PRE>public int <B>startApp</B>(java.lang.String[] arg)</PRE><DL><DD>Start the peergroup. <p/>In practice, it means starting its main application. But that's for subclasses. GenericPeerGroup does not implement the concept of initial app anylonger. S
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -