⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modulemanager.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><TITLE>ModuleManager (Project JXTA J2SE)</TITLE><META NAME="keywords" CONTENT="net.jxta.impl.util.ModuleManager class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="ModuleManager (Project JXTA J2SE)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ModuleManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><a href='http://www.jxta.org' target='_blank'>Project JXTA</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../net/jxta/impl/util/JxtaTimer.html" title="class in net.jxta.impl.util"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../net/jxta/impl/util/ProducerBiasedQueue.html" title="class in net.jxta.impl.util"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="ModuleManager.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">net.jxta.impl.util</FONT><BR>Class ModuleManager</H2><PRE>java.lang.Object  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by"><B>net.jxta.impl.util.ModuleManager</B></PRE><HR><DL><DT>public class <B>ModuleManager</B><DT>extends java.lang.Object</DL><P>Module Manager. This class allows to manage modules to be loaded, started and stopped within a PeerGroup. Modules that are loaded using the ModuleManager do not need to be listed within the PeerGroup advertisement, nor do they have to have published their ModuleSpec and ModuleImpl advertisements: the ModuleManager takes care of this task. However, other peers which may want to load the Module will also have to use its own loader (or the ModuleManager itself, of course): the ModuleManager only manages Modules on the local peer. The Module Manager allows, as an option, to use an application provided class loader. The default class loader is the PeerGroup class loader. The following exemple shows how to use the ModuleManager: <pre>      // Get the peergroup      PeerGroup group = getMyPeerGroup();      // Get the ModuleManager      ModuleManager moduleManager = ModuleManager.getModuleManager (group);      // Is the Module already loaded ?      Module module = moduleManager.lookupModule ("SampleModule");      if (module == null) {          // SampleModue is not loaded yet. Load it now.          module = moduleManager.loadModule ( "SampleModule", "net.jxta.app.SampleModule.SampleModule");      }      // Start SampleModule      moduleManager.startModule ("SampleModule", moduleArgs); </pre><P><P><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><A NAME="nested_class_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Nested Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;interface</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.ModuleManagerLoader.html" title="interface in net.jxta.impl.util">ModuleManager.ModuleManagerLoader</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ModuleManagerLoader interface. </TD></TR></TABLE>&nbsp;<!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.html#createServiceAdvertisement(net.jxta.peergroup.PeerGroup, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, net.jxta.platform.ModuleClassID, net.jxta.platform.ModuleSpecID, java.lang.String, net.jxta.document.Advertisement, long, long)">createServiceAdvertisement</A></B>(<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A>&nbsp;group,                           java.lang.String&nbsp;moduleName,                           java.lang.String&nbsp;description,                           java.lang.String&nbsp;moduleSpecURI,                           java.lang.String&nbsp;moduleCode,                           java.lang.String&nbsp;moduleCodeURI,                           <A HREF="../../../../net/jxta/platform/ModuleClassID.html" title="class in net.jxta.platform">ModuleClassID</A>&nbsp;mcID,                           <A HREF="../../../../net/jxta/platform/ModuleSpecID.html" title="class in net.jxta.platform">ModuleSpecID</A>&nbsp;msID,                           java.lang.String&nbsp;code,                           <A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;serviceAdv,                           long&nbsp;localTTL,                           long&nbsp;remoteTTL)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a Module Class, Spec, and Impl advertisements, and adds the service  Advertisement as part of the Module Impl Advertisement, and publishes the advertisements  in local cache</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../../net/jxta/impl/util/ModuleManager.html" title="class in net.jxta.impl.util">ModuleManager</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.html#getModuleManager(net.jxta.peergroup.PeerGroup)">getModuleManager</A></B>(<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A>&nbsp;group)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getModuleManager This method is used in order to get the instance of the ModuleManager for a given PeerGroup. getModuleManager will create a new instance automatically if there is no instance for the given PeerGroup.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.html#getServiceAdvertisement(net.jxta.peergroup.PeerGroup, net.jxta.protocol.ModuleImplAdvertisement, java.lang.String)">getServiceAdvertisement</A></B>(<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A>&nbsp;group,                        <A HREF="../../../../net/jxta/protocol/ModuleImplAdvertisement.html" title="class in net.jxta.protocol">ModuleImplAdvertisement</A>&nbsp;mia,                        java.lang.String&nbsp;advertismentType)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retreives a Service Advertisement from a module impl advertisement</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.html#loadModule(java.lang.String, net.jxta.impl.util.ModuleManager.ModuleManagerLoader)">loadModule</A></B>(java.lang.String&nbsp;moduleName,           <A HREF="../../../../net/jxta/impl/util/ModuleManager.ModuleManagerLoader.html" title="interface in net.jxta.impl.util">ModuleManager.ModuleManagerLoader</A>&nbsp;loader)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadModule Loads a Module. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.html#loadModule(java.lang.String, java.lang.String)">loadModule</A></B>(java.lang.String&nbsp;moduleName,           java.lang.String&nbsp;moduleCode)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadModule Loads a Module. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.html#lookupModule(java.lang.String)">lookupModule</A></B>(java.lang.String&nbsp;moduleName)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lookupModule Get the Module from its symbolic name.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/ModuleManager.html#startModule(java.lang.String, java.lang.String[])">startModule</A></B>(java.lang.String&nbsp;moduleName,            java.lang.String[]&nbsp;args)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;startModule This method is invoked by the application to start a previously loaded module.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -