📄 peergroupexception.html
字号:
</li> <li><A HREF="../../../../net/jxta/platform/Module.html#START_AGAIN_PROGRESS"><CODE>Module.START_AGAIN_PROGRESS</CODE></A>: The module remains in the list of modules to be started and its <A HREF="../../../../net/jxta/platform/Module.html#startApp(java.lang.String[])"><CODE>Module.startApp(String[])</CODE></A> method will be invoked during the next iteration, if there is one. </li> <li><A HREF="../../../../net/jxta/platform/Module.html#START_AGAIN_STALLED"><CODE>Module.START_AGAIN_STALLED</CODE></A>: The module remains in the list of modules to be started and its <A HREF="../../../../net/jxta/platform/Module.html#startApp(java.lang.String[])"><CODE>Module.startApp(String[])</CODE></A> method will be invoked during the next iteration if there is one. </li> <li>Any other value: The module failed to initialize. Its <A HREF="../../../../net/jxta/platform/Module.html#startApp(java.lang.String[])"><CODE>Module.startApp(String[])</CODE></A> method will not be invoked again.</li> </ul> <p/>Iterations through the list stop when: <ul> <li>The list is empty: the group initialization proceeds.</li> <li>A complete iteration was performed and all modules returned <A HREF="../../../../net/jxta/platform/Module.html#START_AGAIN_STALLED"><CODE>Module.START_AGAIN_STALLED</CODE></A>: a <A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception"><CODE>PeerGroupException</CODE></A> is thrown.</li> <li>A number of complete iteration completed without any module returning <A HREF="../../../../net/jxta/platform/Module.html#START_OK"><CODE>Module.START_OK</CODE></A>: a <A HREF="../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception"><CODE>PeerGroupException</CODE></A> is thrown. The number of complete iterations before that happens is computed as 1 + the square of the number of modules currently in the list.</li> </ul> <p/>This implementation initializes the configuration advertisement with that of the parent group and otherwise behave exactly like its superclass.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B>ShadowPeerGroup.</B><B><A HREF="../../../../net/jxta/impl/peergroup/ShadowPeerGroup.html#initLast()">initLast</A></B>()</CODE><BR> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></FONT></TD><TD><CODE><B>PeerGroupInterface.</B><B><A HREF="../../../../net/jxta/impl/peergroup/PeerGroupInterface.html#loadModule(net.jxta.id.ID, net.jxta.document.Advertisement)">loadModule</A></B>(<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)</CODE><BR> Load a module from a ModuleImplAdv. Compatibility is checked and load is attempted. If compatible and loaded successfuly, the resulting Module is initialized and returned. In most cases the other loadModule() method should be preferred, since unlike this one, it will seek many compatible implementation advertisements and try them all until one works. The home group of the new module (its parent group if the new module is a group) will be this group.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A></CODE></FONT></TD><TD><CODE><B>PeerGroupInterface.</B><B><A HREF="../../../../net/jxta/impl/peergroup/PeerGroupInterface.html#newGroup(net.jxta.document.Advertisement)">newGroup</A></B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> pgAdv)</CODE><BR> Instantiate a peer group from its given advertisement. This instantiator requires that the ModuleImplAdvertisment for the peer group and the ModuleImplAdvertisements for the group's services be available for discovery within the current group. <p/>The pgAdv itself may be all new and unpublished. Therefore, the two typical uses of this routine are: <ul> <li>Creating an all new group with a new ID while using an existing and published implementation. (Possibly a new one published for that purpose). The information should first be gathered in a new PeerGroupAdvertisement which is then passed to this method.</li> <li>Instantiating a group which advertisement has already been discovered (therefore there is no need to find it by groupID again).</li> </ul> <p/>To create a group from a known implAdv, use <A HREF="../../../../net/jxta/peergroup/PeerGroup.html#newGroup(net.jxta.peergroup.PeerGroupID, net.jxta.document.Advertisement, java.lang.String, java.lang.String)"><CODE>PeerGroup.newGroup(PeerGroupID,Advertisement,String,String)</CODE></A></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A></CODE></FONT></TD><TD><CODE><B>PeerGroupInterface.</B><B><A HREF="../../../../net/jxta/impl/peergroup/PeerGroupInterface.html#newGroup(net.jxta.peergroup.PeerGroupID, net.jxta.document.Advertisement, java.lang.String, java.lang.String)">newGroup</A></B>(<A HREF="../../../../net/jxta/peergroup/PeerGroupID.html" title="class in net.jxta.peergroup">PeerGroupID</A> gid, <A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> impl, java.lang.String name, java.lang.String description)</CODE><BR> Instantiates a new group from its elementary pieces and publishes the corresponding PeerGroupAdvertisement. The pieces are: the groups implementation adv, the group id, the name and description. <p/>The typical use of this routine is creating a whole new group based on a newly created and possibly unpublished implementation adv. <p/>This is a convenience method equivalent to either: <p/><pre> newGrp = thisGroup.loadModule(gid, impl); newGrp.publishGroup(name, description); </pre> <p/>or, but only if the implementation advertisement has been published: <p/><pre> newPGAdv = AdvertisementFactory.newAdvertisement( PeerGroupAdvertisement.getAdvertisementType()); newPGAdv.setPeerGroupID(gid); newPGAdv.setModuleSpecID(impl.getModuleSpecID()); newPGAdv.setName(name); newPGAdv.setDescription(description); newGrp = thisGroup.newGroup(newPGAdv); </pre></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A></CODE></FONT></TD><TD><CODE><B>PeerGroupInterface.</B><B><A HREF="../../../../net/jxta/impl/peergroup/PeerGroupInterface.html#newGroup(net.jxta.peergroup.PeerGroupID)">newGroup</A></B>(<A HREF="../../../../net/jxta/peergroup/PeerGroupID.html" title="class in net.jxta.peergroup">PeerGroupID</A> gid)</CODE><BR> Instantiate a group from its Peer Group ID only. Use this when using a group that has already been published and discovered. <p/>The typical uses of this routine are therefore: <ul> <li>Instantiating a peer group which is assumed to exist and whose Peer Group ID is already known.</li> <li>Creating a new peer group instance using an already published Group advertisement, typically published for that purpose. All other referenced advertisements must also be available.</li> </ul> <p/>To create a group from a known implAdv, just use <A HREF="../../../../net/jxta/peergroup/PeerGroup.html#loadModule(net.jxta.id.ID, net.jxta.document.Advertisement)"><CODE>PeerGroup.loadModule(ID,Advertisement)</CODE></A> or even:<p> <p/><code> grp = new GroupSubClass(); grp.init(parentGroup, gid, impladv); </code> <p/>then, <strong>REMEMBER TO PUBLISH THE GROUP IF IT IS ALL NEW.</strong></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></FONT></TD><TD><CODE><B>GenericPeerGroup.</B><B><A HREF="../../../../net/jxta/impl/peergroup/GenericPeerGroup.html#loadModule(net.jxta.id.ID, net.jxta.document.Advertisement)">loadModule</A></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)</CODE><BR> Load a module from a ModuleImplAdv. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></FONT></TD><TD><CODE><B>GenericPeerGroup.</B><B><A HREF="../../../../net/jxta/impl/peergroup/GenericPeerGroup.html#loadModule(net.jxta.id.ID, net.jxta.document.Advertisement, boolean)">loadModule</A></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)</CODE><BR> Internal version, allows one to make a privileged module (has a ref to the true group obj instead of just an interface. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B>GenericPeerGroup.</B><B><A HREF="../../../../net/jxta/impl/peergroup/GenericPeerGroup.html#init(net.jxta.peergroup.PeerGroup, net.jxta.id.ID, net.jxta.document.Advertisement)">init</A></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)</CODE><BR> 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. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B>GenericPeerGroup.</B><B><A HREF="../../../../net/jxta/impl/peergroup/GenericPeerGroup.html#initFirst(net.jxta.peergroup.PeerGroup, net.jxta.id.ID, net.jxta.document.Advertisement)">initFirst</A></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)</CODE><BR> Performs all initialization steps that need to be performed before any subclass initialization is performed. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></F
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -