<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<!-- NewPage --> | |
<html lang="en"> | |
<head> | |
<!-- Generated by javadoc (1.8.0) on Sun Aug 28 20:42:12 EST 2016 --> | |
<title>ServiceDiscoveryManager (Apache River v3.0.0 API Documentation (internals))</title> | |
<meta name="date" content="2016-08-28"> | |
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> | |
<script type="text/javascript" src="../../../script.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"><!-- | |
try { | |
if (location.href.indexOf('is-external=true') == -1) { | |
parent.document.title="ServiceDiscoveryManager (Apache River v3.0.0 API Documentation (internals))"; | |
} | |
} | |
catch(err) { | |
} | |
//--> | |
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":9,"i14":9,"i15":9,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10}; | |
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; | |
var altColor = "altColor"; | |
var rowColor = "rowColor"; | |
var tableTab = "tableTab"; | |
var activeTableTab = "activeTableTab"; | |
</script> | |
<noscript> | |
<div>JavaScript is disabled on your browser.</div> | |
</noscript> | |
<!-- ========= START OF TOP NAVBAR ======= --> | |
<div class="topNav"><a name="navbar.top"> | |
<!-- --> | |
</a> | |
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> | |
<a name="navbar.top.firstrow"> | |
<!-- --> | |
</a> | |
<ul class="navList" title="Navigation"> | |
<li><a href="../../../overview-summary.html">Overview</a></li> | |
<li><a href="package-summary.html">Package</a></li> | |
<li class="navBarCell1Rev">Class</li> | |
<li><a href="class-use/ServiceDiscoveryManager.html">Use</a></li> | |
<li><a href="package-tree.html">Tree</a></li> | |
<li><a href="../../../deprecated-list.html">Deprecated</a></li> | |
<li><a href="../../../index-all.html">Index</a></li> | |
<li><a href="../../../help-doc.html">Help</a></li> | |
</ul> | |
</div> | |
<div class="subNav"> | |
<ul class="navList"> | |
<li><a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup"><span class="typeNameLink">Prev Class</span></a></li> | |
<li><a href="../../../net/jini/lookup/ServiceDiscoveryManager.CacheTask.html" title="class in net.jini.lookup"><span class="typeNameLink">Next Class</span></a></li> | |
</ul> | |
<ul class="navList"> | |
<li><a href="../../../index.html?net/jini/lookup/ServiceDiscoveryManager.html" target="_top">Frames</a></li> | |
<li><a href="ServiceDiscoveryManager.html" target="_top">No Frames</a></li> | |
</ul> | |
<ul class="navList" id="allclasses_navbar_top"> | |
<li><a href="../../../allclasses-noframe.html">All Classes</a></li> | |
</ul> | |
<div> | |
<script type="text/javascript"><!-- | |
allClassesLink = document.getElementById("allclasses_navbar_top"); | |
if(window==top) { | |
allClassesLink.style.display = "block"; | |
} | |
else { | |
allClassesLink.style.display = "none"; | |
} | |
//--> | |
</script> | |
</div> | |
<div> | |
<ul class="subNavList"> | |
<li>Summary: </li> | |
<li><a href="#nested.class.summary">Nested</a> | </li> | |
<li><a href="#field.summary">Field</a> | </li> | |
<li><a href="#constructor.summary">Constr</a> | </li> | |
<li><a href="#method.summary">Method</a></li> | |
</ul> | |
<ul class="subNavList"> | |
<li>Detail: </li> | |
<li><a href="#field.detail">Field</a> | </li> | |
<li><a href="#constructor.detail">Constr</a> | </li> | |
<li><a href="#method.detail">Method</a></li> | |
</ul> | |
</div> | |
<a name="skip.navbar.top"> | |
<!-- --> | |
</a></div> | |
<!-- ========= END OF TOP NAVBAR ========= --> | |
<!-- ======== START OF CLASS DATA ======== --> | |
<div class="header"> | |
<div class="subTitle">net.jini.lookup</div> | |
<h2 title="Class ServiceDiscoveryManager" class="title">Class ServiceDiscoveryManager</h2> | |
</div> | |
<div class="contentContainer"> | |
<ul class="inheritance"> | |
<li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> | |
<li> | |
<ul class="inheritance"> | |
<li>net.jini.lookup.ServiceDiscoveryManager</li> | |
</ul> | |
</li> | |
</ul> | |
<div class="description"> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<hr> | |
<br> | |
<pre>public class <span class="typeNameLabel">ServiceDiscoveryManager</span> | |
extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> | |
<div class="block">The <code>ServiceDiscoveryManager</code> class is a helper utility class that | |
any client-like entity can use to "discover" services registered with any | |
number of lookup services of interest. On behalf of such entities, this class | |
maintains - as much as possible - up-to-date state information about both the | |
lookup services the entity wishes to query, and the services the entity | |
wishes to acquire and use. By maintaining current service state information, | |
the entity can implement efficient mechanisms for service access and usage. | |
<p> | |
There are three basic usage patterns for this class. In order of importance | |
and typical usage, those patterns are: | |
<p> | |
<ul> | |
<li> The entity requests that the <code>ServiceDiscoveryManager</code> create | |
a cache (an instance of <a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup"><code>LookupCache</code></a>) | |
which will asynchronously "discover", and locally store, references to | |
services that match criteria defined by the entity; services which are | |
registered with one or more lookup services managed by the | |
<code>ServiceDiscoveryManager</code> on behalf of the entity. The cache can | |
be viewed as a set of service references that the entity can access locally | |
as needed through one of the public, non-remote methods provided in the | |
cache's interface. Thus, rather than making costly remote queries of multiple | |
lookup services at the point in time when the entity needs the service, the | |
entity can simply make local queries on the cache for the services that the | |
cache acquired and stored at a prior time. An entity should employ this | |
pattern when the entity must make <i>frequent</i> | |
queries for multiple services. By populating the cache with multiple | |
instances of the desired services, redundancy in the availability of those | |
services can be provided. Thus, if an instance of a service is found to be | |
unavailable when needed, the entity can execute a local query on the cache | |
rather than one or more remote queries on the lookup services to acquire an | |
instance that is available. To employ this pattern, the entity invokes the | |
method <a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#createLookupCache-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-net.jini.lookup.ServiceDiscoveryListener-"><code>createLookupCache</code></a>. | |
<li> The entity can register with the event mechanism provided by the | |
<code>ServiceDiscoveryManager</code>. This event mechanism allows the entity | |
to request that it be notified when a service of interest is discovered for | |
the first time, or has encountered a state change such as removal from all | |
lookup services, or attribute set changes. Although interacting with a local | |
cache of services in the way described in the first pattern can be very | |
useful to entities that need frequent access to multiple services, some | |
client-like entities may wish to interact with the cache in a reactive | |
manner. For example, an entity such as a service browser typically wishes to | |
be notified of the arrival of new services of interest as well as any changes | |
in the state of the current services in the cache. In these situations, | |
polling for such changes is usually viewed as undesirable. If the cache were | |
to also provide an event mechanism with notification semantics, the needs of | |
entities that employ either pattern can be satisfied. To employ this pattern, | |
the entity must create a cache and supply it with an instance of the <a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup"><code>ServiceDiscoveryListener</code></a> interface that will receive instances of | |
<a href="../../../net/jini/lookup/ServiceDiscoveryEvent.html" title="class in net.jini.lookup"><code>ServiceDiscoveryEvent</code></a> when | |
events of interest, related to the services in the cache, occur. | |
<li> The entity, through the public API of the | |
<code>ServiceDiscoveryManager</code>, can directly query the lookup services | |
managed by the <code>ServiceDiscoveryManager</code> for services of interest; | |
employing semantics similar to the semantics employed in a typical lookup | |
service query made through the | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a> interface. | |
Such queries will result in a remote call being made at the same time the | |
service is needed (unlike the first pattern, in which remote calls typically | |
occur prior to the time the service is needed). This pattern may be useful to | |
entities needing to find services on an infrequent basis, or when the cost of | |
making a remote call is outweighed by the overhead of maintaining a local | |
cache (for example, due to limited resources). Although an entity that needs | |
to query lookup service(s) can certainly make such queries through the | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a> interface, the | |
<code>ServiceDiscoveryManager</code> provides a broad API with semantics that | |
are richer than the semantics of the | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html#lookup-net.jini.core.lookup.ServiceTemplate-"><code>lookup</code></a> methods provided | |
by the <a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a>. This API encapsulates functionality that many client-like | |
entities may find more useful when managing both the set of desired lookup | |
services, and the service queries made on those lookup services. To employ | |
this pattern, the entity simply instantiates this class with the desired | |
parameters, and then invokes the appropriate version of the | |
<a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#lookup-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-"><code>lookup</code></a> method when the | |
entity wishes to acquire a service that matches desired criteria. | |
</ul> | |
<p> | |
All three mechanisms just described - local queries on the cache, service | |
discovery notification, and remote lookups - employ the same | |
template-matching scheme as that employed in the | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a> interface. | |
Additionally, each mechanism allows the entity to supply an object referred | |
to as a <i>filter</i>; an instance of | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup"><code>ServiceItemFilter</code></a>. A filter is a | |
non-remote object that defines additional matching criteria that the | |
<code>ServiceDiscoveryManager</code> applies when searching for the entity's | |
services of interest. Employing a filter is particularly useful to entities | |
that wish to extend the capabilities of the standard template-matching | |
scheme. | |
<p> | |
In addition to (or instead of) employing a filter to apply additional | |
matching criteria to candidate service proxies initially found through | |
template matching, filters can also be used to extend the selection process | |
so that only proxies that are <i>safe</i> to use are returned to the entity. | |
To do this, the entity would use the | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup"><code>ServiceItemFilter</code></a> interface to | |
supply the <code>ServiceDiscoveryManager</code> or | |
<a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup"><code>LookupCache</code></a> with a filter that, when | |
applied to a candidate proxy, performs a set of operations that is referred | |
to as <i>proxy preparation</i>. As described in the documentation for | |
<a href="../../../net/jini/security/ProxyPreparer.html" title="interface in net.jini.security"><code>ProxyPreparer</code></a>, proxy preparation typically includes | |
operations such as, verifying trust in the proxy, specifying client | |
constraints, and dynamically granting necessary permissions to the proxy. | |
<p> | |
Note that this utility class is not remote. Clients and services that wish to | |
use this class will create an instance of this class in their own address | |
space to manage the state of discovered services and their associated lookup | |
services locally.</div> | |
<dl> | |
<dt><span class="simpleTagLabel">Author:</span></dt> | |
<dd>Sun Microsystems, Inc.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery"><code>DiscoveryManagement</code></a>, | |
<a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup"><code>LookupCache</code></a>, | |
<a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup"><code>ServiceDiscoveryListener</code></a>, | |
<a href="../../../net/jini/lookup/ServiceDiscoveryEvent.html" title="class in net.jini.lookup"><code>ServiceDiscoveryEvent</code></a>, | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a></dd> | |
<dt><span class="simpleTagLabel">Implementation Specifics:</span></dt> | |
<dd><!-- Implementation Specifics --> | |
The following implementation-specific items are discussed below: | |
<ul><li> <a href="#sdmConfigEntries">Configuring ServiceDiscoveryManager</a> | |
<li> <a href="#sdmLogging">Logging</a> | |
</ul> | |
<a name="sdmConfigEntries"> | |
<p> | |
<b><font size="+1">Configuring ServiceDiscoveryManager</font></b> | |
<p> | |
</a> | |
This implementation of <code>ServiceDiscoveryManager</code> supports the | |
following configuration entries; where each configuration entry name is | |
associated with the component name | |
<code>net.jini.lookup.ServiceDiscoveryManager</code>. Note that the | |
configuration entries specified here are specific to this implementation of | |
<code>ServiceDiscoveryManager</code>. Unless otherwise stated, each entry is | |
retrieved from the configuration only once per instance of this utility, | |
where each such retrieval is performed in the constructor. | |
<p> | |
It is important to note that in addition to allowing a client of this utility | |
to request - through the public API - the creation of a cache that is used | |
externally by the client, this utility also creates instances of the cache | |
that are used internally by the utility itself. As such, in addition to the | |
configuration entries that are used only in this utility (and not in any | |
cache), and the configuration entries that are retrieved during the | |
construction of each new cache (and used by only that cache), there are | |
configuration entries specified below that are retrieved once during the | |
construction of this utility, but which are shared with, and used by, the | |
caches that are created. | |
<a name="cacheExecutorService"> | |
<table summary="Describes the cacheExecutorService configuration entry" | |
border="0" cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>cacheExecutorService</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html?is-external=true" title="class or interface in java.util"><code>ExecutorService</code></a> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code>new | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html?is-external=true" title="class or interface in java.util"><code>ThreadPoolExecutor</code></a>( 10, 10, 15, TimeUnit.SECONDS, new LinkedBlockingQueue(), | |
new NamedThreadFactory( "SDM lookup cache", false ))</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> The object that pools and manages the various threads executed by each | |
of the lookup caches created by this utility. There is one such | |
ExecutorService created for each cache. For each cache that is created in | |
this utility, a single, separate instance of this ExecutorService will be | |
retrieved and employed by that cache. This object should not be shared with | |
other components in the application that employs this utility. | |
</table> | |
</a> | |
<a name="discardExecutorService"> | |
<table summary="Describes the discardExecutorService configuration entry" | |
border="0" cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>discardExecutorService</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html?is-external=true" title="class or interface in java.util"><code>ExecutorService</code></a> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code>new | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html?is-external=true" title="class or interface in java.util"><code>ThreadPoolExecutor</code></a>( 10, 10, 15, TimeUnit.SECONDS, new LinkedBlockingQueue(), | |
new NamedThreadFactory( "SDM discard timer", false ))</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> The object that pools and manages the threads, executed by a cache, that | |
wait on verification events after a previousy discovered service has been | |
discarded. For each cache that is created in this utility, a single, separate | |
instance of this ExecutorService will be retrieved and employed by that | |
cache. This object should not be shared with other components in the | |
application that employs this utility. | |
</table> | |
</a> | |
<a name="discardWait"> | |
<table summary="Describes the discardWait configuration entry" border="0" | |
cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>discardWait</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <code>long</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code>2*(5*60*1000)</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> The value used to affect the behavior of the mechanism that handles the | |
<i>service discard problem</i> described in this utility's specification. | |
This item allows each entity that uses this utility to define how long (in | |
milliseconds) to wait for verification from the lookup service(s) that a | |
discarded service is actually down before committing or un-committing a | |
requested service discard. The current implementation of this utility | |
defaults to waiting 10 minutes (twice the maximum lease duration granted by | |
the Reggie implementation of the lookup service). Note that this item is used | |
only by the caches (both internal and external) that are created by this | |
utility, and not by the utility itself. | |
</table> | |
</a> | |
<a name="discoveryManager"> | |
<table summary="Describes the discoveryManager configuration entry" | |
border="0" cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>discoveryManager</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery"><code>DiscoveryManagement</code></a> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code> new | |
<a href="../../../net/jini/discovery/LookupDiscoveryManager.html#LookupDiscoveryManager-java.lang.String:A-net.jini.core.discovery.LookupLocator:A-net.jini.discovery.DiscoveryListener-net.jini.config.Configuration-"><code>LookupDiscoveryManager</code></a>( new | |
java.lang.String[] {""}, new | |
<a href="../../../net/jini/core/discovery/LookupLocator.html" title="class in net.jini.core.discovery"><code>LookupLocator</code></a>[0], null, config)</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> The object used to manage the discovery processing performed by this | |
utility. This entry will be retrieved from the configuration only if no | |
discovery manager is specified in the constructor. Note that this object | |
should not be shared with other components in the application that employs | |
this utility. This item is used only by the service discovery manager, and | |
not by any cache that is created. | |
</table> | |
</a> | |
<a name="eventLeasePreparer"> | |
<table summary="Describes the eventLeasePreparer configuration entry" | |
border="0" cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>eventLeasePreparer</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <a href="../../../net/jini/security/ProxyPreparer.html" title="interface in net.jini.security"><code>ProxyPreparer</code></a> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code>new <a href="../../../net/jini/security/BasicProxyPreparer.html" title="class in net.jini.security"><code>BasicProxyPreparer</code></a>() | |
</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> Preparer for the leases returned when a cache registers with the event | |
mechanism of any of the discovered lookup services. This item is used only by | |
the caches (both internal and external) that are created by this utility, and | |
not by the utility itself. | |
<p> | |
Currently, no methods of the returned proxy are invoked by this utility. | |
</table> | |
</a> | |
<a name="eventListenerExporter"> | |
<table summary="Describes the eventListenerExporter configuration entry" | |
border="0" cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>eventListenerExporter</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <a href="../../../net/jini/export/Exporter.html" title="interface in net.jini.export"><code>Exporter</code></a> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code> new | |
<a href="../../../net/jini/jeri/BasicJeriExporter.html#BasicJeriExporter-net.jini.jeri.ServerEndpoint-net.jini.jeri.InvocationLayerFactory-boolean-boolean-"><code>BasicJeriExporter</code></a>( | |
<a href="../../../net/jini/jeri/tcp/TcpServerEndpoint.html#getInstance-int-"><code>TcpServerEndpoint.getInstance</code></a>(0),<br> | |
                        new | |
<a href="../../../net/jini/jeri/BasicILFactory.html" title="class in net.jini.jeri"><code>BasicILFactory</code></a>(),<br> | |
                        | |
false, false)</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> Exporter for the remote event listener that each cache supplies to the | |
lookup services whose event mechanisms those caches register with. Note that | |
for each cache that is created in this utility, a single, separate instance | |
of this exporter will be retrieved and employed by that cache. Note also that | |
the default exporter defined here will disable distributed garbage collection | |
(DGC) for the server endpoint associated with the exported listener, and the | |
listener backend (the "impl") will be strongly referenced. This means that | |
the listener will not "go away" unintentionally. Additionally, that exporter | |
also sets the <code>keepAlive</code> flag to <code>false</code> to allow the | |
VM in which this utility runs to "go away" when desired; and not be kept | |
alive simply because the listener is still exported. | |
</table> | |
</a> | |
<a name="leaseManager"> | |
<table summary="Describes the leaseManager configuration entry" border="0" | |
cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>leaseManager</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease"><code>LeaseRenewalManager</code></a> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code> new | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html#LeaseRenewalManager-net.jini.config.Configuration-"><code>LeaseRenewalManager</code></a>(config)</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> The object used to manage any event leases returned to a cache that has | |
registered with the event mechanism of the various discovered lookup | |
services. This entry will be retrieved from the configuration only if no | |
lease renewal manager is specified in the constructor. This item is used only | |
by the caches (both internal and external) that are created by this utility, | |
and not by the utility itself. | |
</table> | |
</a> | |
<a name="registrarPreparer"> | |
<table summary="Describes the registrarPreparer configuration entry" | |
border="0" cellpadding="2"> | |
<tr valign="top"> | |
<th scope="col" summary="layout"> <font size="+1">•</font> | |
<th scope="col" align="left" colspan="2"> <font size="+1"> | |
<code>registrarPreparer</code></font> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Type: <td> <a href="../../../net/jini/security/ProxyPreparer.html" title="interface in net.jini.security"><code>ProxyPreparer</code></a> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Default: <td> <code>new <a href="../../../net/jini/security/BasicProxyPreparer.html" title="class in net.jini.security"><code>BasicProxyPreparer</code></a>() | |
</code> | |
<tr valign="top"> <td>   <th scope="row" align="right"> | |
Description: | |
<td> Preparer for the proxies to the lookup services that are discovered and | |
used by this utility. This item is used only by the service discovery | |
manager, and not by any cache that is created. | |
<p> | |
The following methods of the proxy returned by this preparer are invoked by | |
this utility: | |
<ul> | |
<li><a href="../../../net/jini/core/lookup/ServiceRegistrar.html#lookup-net.jini.core.lookup.ServiceTemplate-"><code>lookup</code></a> | |
<li><a href="../../../net/jini/core/lookup/ServiceRegistrar.html#notify-net.jini.core.lookup.ServiceTemplate-int-net.jini.core.event.RemoteEventListener-java.rmi.MarshalledObject-long-"><code>notify</code></a> | |
</ul> | |
</table> | |
</a> | |
<a name="sdmLogging"> | |
<p> | |
<b><font size="+1">Logging</font></b> | |
<p> | |
</a> | |
This implementation of <code>ServiceDiscoveryManager</code> uses the | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging"><code>Logger</code></a> named <code>net.jini.lookup.ServiceDiscoveryManager</code> to | |
log information at the following logging levels: | |
<p> | |
<table border="1" cellpadding="5" summary="Describes the information logged | |
by ServiceDiscoveryManager, and the levels at which that information is | |
logged"> | |
<caption halign="center" valign="top"> | |
<b><code>net.jini.lookup.ServiceDiscoveryManager</code></b> | |
</caption> | |
<tr> <th scope="col"> Level</th> | |
<th scope="col"> Description</th> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#INFO" title="class or interface in java.util.logging"><code>INFO</code></a></td> | |
<td> | |
when any exception occurs while querying a lookup service, or upon applying a | |
filter to the results of such a query | |
</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#INFO" title="class or interface in java.util.logging"><code>INFO</code></a></td> | |
<td> | |
when any exception occurs while attempting to register with the event | |
mechanism of a lookup service, or while attempting to prepare the lease on | |
the registration with that event mechanism | |
</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#INFO" title="class or interface in java.util.logging"><code>INFO</code></a></td> | |
<td>when any exception occurs while attempting to prepare a proxy</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#INFO" title="class or interface in java.util.logging"><code>INFO</code></a></td> | |
<td> | |
when an <code>IllegalStateException</code> occurs while discarding a lookup | |
service proxy after logging a failure that has occurred in one of the tasks | |
executed by this utility | |
</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#INFO" title="class or interface in java.util.logging"><code>INFO</code></a></td> | |
<td>upon failure of the lease renewal process</td> | |
</tr> | |
<tr> | |
<td><a href="../../../org/apache/river/logging/Levels.html#HANDLED"><code>HANDLED</code></a></td> | |
<td> | |
when an exception occurs because a remote call to a lookup service has been | |
interrupted as a result of the termination of a cache | |
</td> | |
</tr> | |
<tr> | |
<td><a href="../../../org/apache/river/logging/Levels.html#HANDLED"><code>HANDLED</code></a></td> | |
<td> | |
when a "gap" is encountered in an event sequence from a lookup service | |
</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#FINER" title="class or interface in java.util.logging"><code>FINER</code></a></td> | |
<td>upon failure of the lease cancellation process</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#FINEST" title="class or interface in java.util.logging"><code>FINEST</code></a></td> | |
<td>whenever any task is started</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#FINEST" title="class or interface in java.util.logging"><code>FINEST</code></a></td> | |
<td>whenever any task completes successfully</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#FINEST" title="class or interface in java.util.logging"><code>FINEST</code></a></td> | |
<td>whenever a lookup cache is created</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#FINEST" title="class or interface in java.util.logging"><code>FINEST</code></a></td> | |
<td>whenever a lookup cache is terminated</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#FINEST" title="class or interface in java.util.logging"><code>FINEST</code></a></td> | |
<td>whenever a proxy is prepared</td> | |
</tr> | |
<tr> | |
<td><a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html?is-external=true#FINEST" title="class or interface in java.util.logging"><code>FINEST</code></a></td> | |
<td> | |
when an exception (that is, <code>IllegalStateException</code>) occurs while | |
unexporting a cache's remote event listener while the cache is being | |
terminated | |
</td> | |
</tr> | |
</table> | |
<p> | |
See the <a href="../../../org/apache/river/logging/LogManager.html" title="class in org.apache.river.logging"><code>LogManager</code></a> class for one way to use the | |
logging level <a href="../../../org/apache/river/logging/Levels.html#HANDLED"><code>HANDLED</code></a> in standard | |
logging configuration files. | |
<p></dd> | |
</dl> | |
</li> | |
</ul> | |
</div> | |
<div class="summary"> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<!-- ======== NESTED CLASS SUMMARY ======== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="nested.class.summary"> | |
<!-- --> | |
</a> | |
<h3>Nested Class Summary</h3> | |
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> | |
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> | |
<tr> | |
<th class="colFirst" scope="col">Modifier and Type</th> | |
<th class="colLast" scope="col">Class and Description</th> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.CacheTask.html" title="class in net.jini.lookup">ServiceDiscoveryManager.CacheTask</a></span></code> | |
<div class="block">Class for implementing register/lookup/notify/dropProxy/discard tasks</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.CacheTaskDependencyManager.html" title="class in net.jini.lookup">ServiceDiscoveryManager.CacheTaskDependencyManager</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>(package private) static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.CacheTaskWrapper.html" title="class in net.jini.lookup">ServiceDiscoveryManager.CacheTaskWrapper</a><<a href="../../../net/jini/lookup/ServiceDiscoveryManager.CacheTaskWrapper.html" title="type parameter in ServiceDiscoveryManager.CacheTaskWrapper">T</a>></span></code> | |
<div class="block">ObservableFuture wrapper class for CacheTask's.</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.DiscMgrListener.html" title="class in net.jini.lookup">ServiceDiscoveryManager.DiscMgrListener</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.EventReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.EventReg</a></span></code> | |
<div class="block">Data structure used to group together the lease and event sequence | |
number.</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.Initializer.html" title="class in net.jini.lookup">ServiceDiscoveryManager.Initializer</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.LeaseListenerImpl.html" title="class in net.jini.lookup">ServiceDiscoveryManager.LeaseListenerImpl</a></span></code> | |
<div class="block">The Listener class for the LeaseRenewalManager.</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.LookupCacheImpl.html" title="class in net.jini.lookup">ServiceDiscoveryManager.LookupCacheImpl</a></span></code> | |
<div class="block">Internal implementation of the LookupCache interface.</div> | |
</td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.LookupCacheTerminator.html" title="class in net.jini.lookup">ServiceDiscoveryManager.LookupCacheTerminator</a></span></code> | |
<div class="block">Allows termination of LookupCacheImpl so blocking lookup can return | |
quickly</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a></span></code> | |
<div class="block">A wrapper class for a ServiceRegistrar.</div> | |
</td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.ServiceDiscoveryListenerImpl.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ServiceDiscoveryListenerImpl</a></span></code> | |
<div class="block">Class that defines the listener that will receive local events from the | |
internal LookupCache used in the blocking versions of lookup().</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private static class </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.ServiceItemReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ServiceItemReg</a></span></code> | |
<div class="block">Used in the LookupCache.</div> | |
</td> | |
</tr> | |
</table> | |
</li> | |
</ul> | |
<!-- =========== FIELD SUMMARY =========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="field.summary"> | |
<!-- --> | |
</a> | |
<h3>Field Summary</h3> | |
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> | |
<caption><span>Fields</span><span class="tabEnd"> </span></caption> | |
<tr> | |
<th class="colFirst" scope="col">Modifier and Type</th> | |
<th class="colLast" scope="col">Field and Description</th> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private boolean</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#bTerminated">bTerminated</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private <a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup">LookupCache</a>></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#caches">caches</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#COMPONENT_NAME">COMPONENT_NAME</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private long</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#discardWait">discardWait</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#discMgr">discMgr</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private boolean</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#discMgrInternal">discMgrInternal</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.DiscMgrListener.html" title="class in net.jini.lookup">ServiceDiscoveryManager.DiscMgrListener</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#discMgrListener">discMgrListener</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/security/ProxyPreparer.html" title="interface in net.jini.security">ProxyPreparer</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#eventLeasePreparer">eventLeasePreparer</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#leaseRenewalMgr">leaseRenewalMgr</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private static <a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging">Logger</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#logger">logger</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a>></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#proxyRegSet">proxyRegSet</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#random">random</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/security/ProxyPreparer.html" title="interface in net.jini.security">ProxyPreparer</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#registrarPreparer">registrarPreparer</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private boolean</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#started">started</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.LookupCacheTerminator.html" title="class in net.jini.lookup">ServiceDiscoveryManager.LookupCacheTerminator</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#terminator">terminator</a></span></code> </td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>private <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html?is-external=true" title="class or interface in java.lang">Thread</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#terminatorThread">terminatorThread</a></span></code> </td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#thisConfig">thisConfig</a></span></code> </td> | |
</tr> | |
</table> | |
</li> | |
</ul> | |
<!-- ======== CONSTRUCTOR SUMMARY ======== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="constructor.summary"> | |
<!-- --> | |
</a> | |
<h3>Constructor Summary</h3> | |
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> | |
<caption><span>Constructors</span><span class="tabEnd"> </span></caption> | |
<tr> | |
<th class="colFirst" scope="col">Modifier</th> | |
<th class="colLast" scope="col">Constructor and Description</th> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code> </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#ServiceDiscoveryManager-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-">ServiceDiscoveryManager</a></span>(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr)</code> | |
<div class="block">Constructs an instance of <code>ServiceDiscoveryManager</code> which | |
will, on behalf of the entity that constructs this class, discover and | |
manage a set of lookup services, as well as discover and manage sets of | |
services registered with those lookup services.</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code> </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#ServiceDiscoveryManager-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-net.jini.config.Configuration-">ServiceDiscoveryManager</a></span>(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr, | |
<a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a> config)</code> | |
<div class="block">Constructs an instance of this class, which is configured using the items | |
retrieved through the given <code>Configuration</code>, that will, on | |
behalf of the entity that constructs this class, discover and manage a | |
set of lookup services, as well as discover and manage sets of services | |
registered with those lookup services.</div> | |
</td> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>private </code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#ServiceDiscoveryManager-net.jini.lookup.ServiceDiscoveryManager.Initializer-">ServiceDiscoveryManager</a></span>(<a href="../../../net/jini/lookup/ServiceDiscoveryManager.Initializer.html" title="class in net.jini.lookup">ServiceDiscoveryManager.Initializer</a> init)</code> </td> | |
</tr> | |
</table> | |
</li> | |
</ul> | |
<!-- ========== METHOD SUMMARY =========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="method.summary"> | |
<!-- --> | |
</a> | |
<h3>Method Summary</h3> | |
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> | |
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> | |
<tr> | |
<th class="colFirst" scope="col">Modifier and Type</th> | |
<th class="colLast" scope="col">Method and Description</th> | |
</tr> | |
<tr id="i0" class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a>[]</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#buildServiceRegistrar--">buildServiceRegistrar</a></span>()</code> | |
<div class="block">Returns array of ServiceRegistrar created from the proxyRegSet</div> | |
</td> | |
</tr> | |
<tr id="i1" class="rowColor"> | |
<td class="colFirst"><code>private void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#cacheAddProxy-net.jini.lookup.ServiceDiscoveryManager.ProxyReg-">cacheAddProxy</a></span>(<a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a> reg)</code> | |
<div class="block">Adds the given proxy to all the caches maintained by the SDM.</div> | |
</td> | |
</tr> | |
<tr id="i2" class="altColor"> | |
<td class="colFirst"><code>private void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#cancelLease-net.jini.core.lease.Lease-">cancelLease</a></span>(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> lease)</code> | |
<div class="block">Cancels the given event lease.</div> | |
</td> | |
</tr> | |
<tr id="i3" class="rowColor"> | |
<td class="colFirst"><code>private void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#checkTerminated--">checkTerminated</a></span>()</code> | |
<div class="block">Throws an IllegalStateException if the current instance of the | |
ServiceDiscoveryManager has been terminated.</div> | |
</td> | |
</tr> | |
<tr id="i4" class="altColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup">LookupCache</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#createLookupCache-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-net.jini.lookup.ServiceDiscoveryListener-">createLookupCache</a></span>(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
<a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup">ServiceDiscoveryListener</a> listener)</code> | |
<div class="block">The <code>createLookupCache</code> method allows the client-like entity | |
to request that the <code>ServiceDiscoveryManager</code> create a new | |
managed set (or cache) and populate it with services, which match | |
criteria defined by the entity, and whose references are registered with | |
one or more of the lookup services the entity has targeted for discovery.</div> | |
</td> | |
</tr> | |
<tr id="i5" class="rowColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.LookupCacheImpl.html" title="class in net.jini.lookup">ServiceDiscoveryManager.LookupCacheImpl</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#createLookupCache-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-net.jini.lookup.ServiceDiscoveryListener-long-">createLookupCache</a></span>(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
<a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup">ServiceDiscoveryListener</a> listener, | |
long leaseDuration)</code> | |
<div class="block">Creates a LookupCache with specific lease duration.</div> | |
</td> | |
</tr> | |
<tr id="i6" class="altColor"> | |
<td class="colFirst"><code>private void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#discard-net.jini.core.lookup.ServiceRegistrar-">discard</a></span>(<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy)</code> | |
<div class="block">Discards a ServiceRegistrar through the discovery manager.</div> | |
</td> | |
</tr> | |
<tr id="i7" class="rowColor"> | |
<td class="colFirst"><code>private void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#dropProxy-net.jini.lookup.ServiceDiscoveryManager.ProxyReg-">dropProxy</a></span>(<a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a> reg)</code> | |
<div class="block">Removes the given proxy from all the caches maintained by the SDM.</div> | |
</td> | |
</tr> | |
<tr id="i8" class="altColor"> | |
<td class="colFirst"><code>private void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#fail-java.lang.Throwable-net.jini.core.lookup.ServiceRegistrar-java.lang.String-java.lang.String-java.lang.String-boolean-">fail</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a> e, | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sourceClass, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sourceMethod, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> msg, | |
boolean cacheTerminated)</code> | |
<div class="block">Convenience method invoked when failure occurs in the cache tasks | |
executed in this utility.</div> | |
</td> | |
</tr> | |
<tr id="i9" class="rowColor"> | |
<td class="colFirst"><code>private boolean</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#filterPassed-net.jini.core.lookup.ServiceItem-net.jini.lookup.ServiceItemFilter-">filterPassed</a></span>(<a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a> item, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</code> | |
<div class="block">Applies the given <code>filter</code> to the given <code>item</code>, and | |
returns <code>true</code> if the <code>filter</code> returns a | |
<code>pass</code> value; otherwise, returns <code>false</code>.</div> | |
</td> | |
</tr> | |
<tr id="i10" class="altColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#getDiscoveryManager--">getDiscoveryManager</a></span>()</code> | |
<div class="block">The <code>getDiscoveryManager</code> method will return an object that | |
implements the <code>DiscoveryManagement</code> interface.</div> | |
</td> | |
</tr> | |
<tr id="i11" class="rowColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#getLeaseRenewalManager--">getLeaseRenewalManager</a></span>()</code> | |
<div class="block">The <code>getLeaseRenewalManager</code> method will return an instance of | |
the <code>LeaseRenewalManager</code> class.</div> | |
</td> | |
</tr> | |
<tr id="i12" class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#getMatchedServiceItem-net.jini.core.lookup.ServiceMatches-net.jini.lookup.ServiceItemFilter-">getMatchedServiceItem</a></span>(<a href="../../../net/jini/core/lookup/ServiceMatches.html" title="class in net.jini.core.lookup">ServiceMatches</a> sm, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</code> | |
<div class="block">From the given set of ServiceMatches, randomly selects and returns a | |
ServiceItem that matches the given filter (if applicable).</div> | |
</td> | |
</tr> | |
<tr id="i13" class="rowColor"> | |
<td class="colFirst"><code>private static <a href="../../../net/jini/lookup/ServiceDiscoveryManager.Initializer.html" title="class in net.jini.lookup">ServiceDiscoveryManager.Initializer</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#init-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-net.jini.config.Configuration-">init</a></span>(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr, | |
<a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a> config)</code> </td> | |
</tr> | |
<tr id="i14" class="altColor"> | |
<td class="colFirst"><code>private static <a href="../../../net/jini/lookup/ServiceDiscoveryManager.Initializer.html" title="class in net.jini.lookup">ServiceDiscoveryManager.Initializer</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#initial-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-net.jini.config.Configuration-">initial</a></span>(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr, | |
<a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a> config)</code> </td> | |
</tr> | |
<tr id="i15" class="rowColor"> | |
<td class="colFirst"><code>private static boolean</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#isArrayContainsServiceItem-java.util.List-net.jini.core.lookup.ServiceItem-">isArrayContainsServiceItem</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a>> a, | |
<a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a> s)</code> | |
<div class="block">Determines if the given ServiceItem is an element of the given array.</div> | |
</td> | |
</tr> | |
<tr id="i16" class="altColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a>[]</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#lookup-net.jini.core.lookup.ServiceTemplate-int-int-net.jini.lookup.ServiceItemFilter-long-">lookup</a></span>(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
int minMatches, | |
int maxMatches, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
long waitDur)</code> | |
<div class="block">Queries each available lookup service in the managed set for service(s) | |
that match the input criteria.</div> | |
</td> | |
</tr> | |
<tr id="i17" class="rowColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a>[]</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#lookup-net.jini.core.lookup.ServiceTemplate-int-net.jini.lookup.ServiceItemFilter-">lookup</a></span>(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
int maxMatches, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</code> | |
<div class="block">Queries each available lookup service in the managed set for service(s) | |
that match the input criteria.</div> | |
</td> | |
</tr> | |
<tr id="i18" class="altColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#lookup-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-">lookup</a></span>(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</code> | |
<div class="block">Queries each available lookup service in the set of lookup services | |
managed by the <code>ServiceDiscoveryManager</code> (the <i>managed | |
set</i>) for a service reference that matches criteria defined by the | |
entity that invokes this method.</div> | |
</td> | |
</tr> | |
<tr id="i19" class="rowColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#lookup-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-long-">lookup</a></span>(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
long waitDur)</code> | |
<div class="block">Queries each available lookup service in the managed set for a service | |
that matches the input criteria.</div> | |
</td> | |
</tr> | |
<tr id="i20" class="altColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.EventReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.EventReg</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#registerListener-net.jini.core.lookup.ServiceRegistrar-net.jini.core.lookup.ServiceTemplate-net.jini.core.event.RemoteEventListener-long-">registerListener</a></span>(<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy, | |
<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event">RemoteEventListener</a> listenerProxy, | |
long duration)</code> | |
<div class="block">Registers for events from the lookup service associated with the given | |
proxy, and returns both the lease and the event sequence number from the | |
event registration wrapped in the locally-defined class, | |
<code>EventReg</code>.</div> | |
</td> | |
</tr> | |
<tr id="i21" class="rowColor"> | |
<td class="colFirst"><code>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#removeReg-net.jini.core.lookup.ServiceRegistrar-">removeReg</a></span>(<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy)</code> | |
<div class="block">Removes and returns element from proxyRegSet that corresponds to the | |
given proxy.</div> | |
</td> | |
</tr> | |
<tr id="i22" class="altColor"> | |
<td class="colFirst"><code>void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#terminate--">terminate</a></span>()</code> | |
<div class="block">The <code>terminate</code> method performs cleanup duties related to the | |
termination of the event mechanism for lookup service discovery, the | |
event mechanism for service discovery, and the cache management duties of | |
the <code>ServiceDiscoveryManager</code>.</div> | |
</td> | |
</tr> | |
</table> | |
<ul class="blockList"> | |
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> | |
<!-- --> | |
</a> | |
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> | |
<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
<div class="details"> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<!-- ============ FIELD DETAIL =========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="field.detail"> | |
<!-- --> | |
</a> | |
<h3>Field Detail</h3> | |
<a name="COMPONENT_NAME"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>COMPONENT_NAME</h4> | |
<pre>private static final <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> COMPONENT_NAME</pre> | |
<dl> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../constant-values.html#net.jini.lookup.ServiceDiscoveryManager.COMPONENT_NAME">Constant Field Values</a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="logger"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>logger</h4> | |
<pre>private static final <a href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging">Logger</a> logger</pre> | |
</li> | |
</ul> | |
<a name="discMgr"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>discMgr</h4> | |
<pre>private final <a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discMgr</pre> | |
</li> | |
</ul> | |
<a name="discMgrInternal"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>discMgrInternal</h4> | |
<pre>private final boolean discMgrInternal</pre> | |
</li> | |
</ul> | |
<a name="discMgrListener"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>discMgrListener</h4> | |
<pre>private final <a href="../../../net/jini/lookup/ServiceDiscoveryManager.DiscMgrListener.html" title="class in net.jini.lookup">ServiceDiscoveryManager.DiscMgrListener</a> discMgrListener</pre> | |
</li> | |
</ul> | |
<a name="leaseRenewalMgr"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>leaseRenewalMgr</h4> | |
<pre>private final <a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseRenewalMgr</pre> | |
</li> | |
</ul> | |
<a name="proxyRegSet"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>proxyRegSet</h4> | |
<pre>private final <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a>> proxyRegSet</pre> | |
</li> | |
</ul> | |
<a name="random"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>random</h4> | |
<pre>private final <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a> random</pre> | |
</li> | |
</ul> | |
<a name="caches"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>caches</h4> | |
<pre>private final <a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup">LookupCache</a>> caches</pre> | |
</li> | |
</ul> | |
<a name="bTerminated"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>bTerminated</h4> | |
<pre>private boolean bTerminated</pre> | |
</li> | |
</ul> | |
<a name="terminatorThread"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>terminatorThread</h4> | |
<pre>private final <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html?is-external=true" title="class or interface in java.lang">Thread</a> terminatorThread</pre> | |
</li> | |
</ul> | |
<a name="terminator"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>terminator</h4> | |
<pre>private final <a href="../../../net/jini/lookup/ServiceDiscoveryManager.LookupCacheTerminator.html" title="class in net.jini.lookup">ServiceDiscoveryManager.LookupCacheTerminator</a> terminator</pre> | |
</li> | |
</ul> | |
<a name="started"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>started</h4> | |
<pre>private boolean started</pre> | |
</li> | |
</ul> | |
<a name="thisConfig"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>thisConfig</h4> | |
<pre>private final <a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a> thisConfig</pre> | |
</li> | |
</ul> | |
<a name="registrarPreparer"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>registrarPreparer</h4> | |
<pre>private final <a href="../../../net/jini/security/ProxyPreparer.html" title="interface in net.jini.security">ProxyPreparer</a> registrarPreparer</pre> | |
</li> | |
</ul> | |
<a name="eventLeasePreparer"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>eventLeasePreparer</h4> | |
<pre>private final <a href="../../../net/jini/security/ProxyPreparer.html" title="interface in net.jini.security">ProxyPreparer</a> eventLeasePreparer</pre> | |
</li> | |
</ul> | |
<a name="discardWait"> | |
<!-- --> | |
</a> | |
<ul class="blockListLast"> | |
<li class="blockList"> | |
<h4>discardWait</h4> | |
<pre>private final long discardWait</pre> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
<!-- ========= CONSTRUCTOR DETAIL ======== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="constructor.detail"> | |
<!-- --> | |
</a> | |
<h3>Constructor Detail</h3> | |
<a name="ServiceDiscoveryManager-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>ServiceDiscoveryManager</h4> | |
<pre>public ServiceDiscoveryManager(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> | |
<div class="block">Constructs an instance of <code>ServiceDiscoveryManager</code> which | |
will, on behalf of the entity that constructs this class, discover and | |
manage a set of lookup services, as well as discover and manage sets of | |
services registered with those lookup services. The entity indicates | |
which lookup services to discover and manage through the parameters input | |
to this constructor. | |
<p> | |
As stated in the class description, this class has three usage patterns: | |
<p> | |
<ul> | |
<li> the entity uses a <a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup"><code>LookupCache</code></a> to locally store and manage discovered services so that | |
those services can be accessed quickly | |
<li> the entity registers with the event mechanism provided by a | |
<a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup"><code>LookupCache</code></a> to be notified when | |
services of interest are discovered | |
<li> the entity uses the <code>ServiceDiscoveryManager</code> to perform | |
remote queries of the lookup services, employing richer semantics than | |
that provided through the standard | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a> interface | |
</ul> | |
<p> | |
Although the first two usage patterns emphasize the use of a cache | |
object, that cache is acquired only through an instance of the | |
<code>ServiceDiscoveryManager</code> class. | |
<p> | |
It is important to note that some of the methods of this class (<a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#createLookupCache-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-net.jini.lookup.ServiceDiscoveryListener-"><code>createLookupCache</code></a> and the <i>blocking</i> versions of | |
<a href="../../../net/jini/lookup/ServiceDiscoveryManager.html#lookup-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-"><code>lookup</code></a> to be | |
exact) can throw a <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi"><code>RemoteException</code></a> when invoked. This is | |
because each of these methods may attempt to register with the event | |
mechanism of at least one lookup service, a process that requires a | |
remote object (a listener) to be exported to the lookup service(s). Both | |
the process of registering with a lookup service's event mechanism and | |
the process of exporting a remote object are processes that can result in | |
a <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi"><code>RemoteException</code></a>. | |
<p> | |
In order to facilitate the exportation of the remote listener just | |
described, the <code>ServiceDiscoveryManager</code> class instantiates an | |
inner class that implements the | |
<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event"><code>RemoteEventListener</code></a> | |
interface. Although this class defines, instantiates, and exports this | |
remote listener, <i>it is the entity's responsibility</i> to provide a | |
mechanism for any lookup service to acquire the proxy to the exported | |
listener. One way to do this is to configure this utility to export the | |
listener using the Jini(TM) Extensible Remote Invocation (Jini ERI) | |
communication framework. When the listener is exported to use Jini ERI, | |
and no proxy customizations (such as a custom invocation handler or | |
transport endpoint) are used, no other action is necessary to make the | |
proxy to the listener available to the lookup service(s) with which that | |
listener is registered. | |
<p> | |
The <a href="#eventListenerExporter">default exporter</a> for this | |
utility will export the remote event listener under Jini ERI, specifying | |
that the port and object ID with which the listener is to be exported | |
should be chosen by the Jini ERI framework, not the deployer. | |
<p> | |
If it is required that the remote event listener be exported under JRMP | |
instead of Jini ERI, then the entity that employs this utility must | |
specify this in its configuration. For example, the entity's | |
configuration would need to contain something like the following: | |
<p> | |
<blockquote> | |
<pre> | |
import net.jini.jrmp.JrmpExporter; | |
application.configuration.component.name { | |
....... | |
....... | |
// configuration items specific to the application | |
....... | |
....... | |
}//end application.configuration.component.name | |
net.jini.lookup.ServiceDiscoveryManager { | |
serverExporter = new JrmpExporter(); | |
}//end net.jini.lookup.ServiceDiscoveryManager | |
</pre> | |
</blockquote> | |
<p> | |
It is important to note that when the remote event listener is exported | |
under JRMP, unlike Jini ERI, the JRMP remote communication framework does | |
<b><i>not</i></b> provide a mechanism that automatically makes the | |
listener proxy available to the lookup service(s) with which the listener | |
is registered; the deployer of the entity, or the entity itself, must | |
provide such a mechanism. | |
<p> | |
When exported under JRMP, one of the more common mechanisms for making | |
the listener proxy available to the lookup service(s) with which the | |
listener is registered consists of the following: | |
<p> | |
<ul><li> store the necessary class files in a JAR file | |
<li> make the class files in the JAR file <i>preferred</i> | |
(see <a href="../../../net/jini/loader/pref/package-summary.html"><code>net.jini.loader.pref</code></a> for details) | |
<li> run an HTTP server to serve up the JAR file to any requesting lookup | |
service | |
<li> advertise the location of that JAR file by setting the | |
<code>java.rmi.server.codebase</code> property of the entity to "point" | |
at the JAR file | |
</ul> | |
<p> | |
For example, suppose an application consists of an entity that intends to | |
use the <code>ServiceDiscoveryManager</code> will run on a host named | |
<b><i>myHost</i></b>. And suppose that the <i>down-loadable</i> JAR file | |
named <b><i>sdm-dl.jar</i></b> that is provided in the distribution is | |
located in the directory <b><i>/files/jini/lib</i></b>, and will be | |
served by an HTTP server listening on port | |
<b><i>8082</i></b>. If the application is run with its codebase property | |
set to | |
<code>-Djava.rmi.server.codebase="http://myHost:8082/sdm-dl.jar"</code>, | |
the lookup service(s) should then be able to access the remote listener | |
exported under JRMP by the <code>ServiceDiscoveryManager</code> on behalf | |
of the entity. | |
<p> | |
If a mechanism for lookup services to access the remote listener exported | |
by the <code>ServiceDiscoveryManager</code> is not provided (either by | |
the remote communication framework itself, or by some other means), the | |
remote methods of the <code>ServiceDiscoveryManager</code> - the methods | |
involved in the two most important usage patterns of that utility - will | |
be of no use. | |
<p> | |
This constructor takes two arguments: an object that implements the | |
<code>DiscoveryManagement</code> interface and a reference to a | |
<code>LeaseRenewalManager</code> object. The constructor throws an | |
<code>IOException</code> because construction of a | |
<code>ServiceDiscoveryManager</code> may initiate the multicast discovery | |
process, a process that can throw an <code>IOException</code>.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>discoveryMgr</code> - the <code>DiscoveryManagement</code> implementation | |
through which notifications that indicate a lookup service has been | |
discovered or discarded will be received. If the value of the argument is | |
<code>null</code>, then an instance of the | |
<code>LookupDiscoveryManager</code> utility class will be constructed to | |
listen for events announcing the discovery of only those lookup services | |
that are members of the public group.</dd> | |
<dd><code>leaseMgr</code> - the <code>LeaseRenewalManager</code> to use. A value of | |
<code>null</code> may be passed as the <code>LeaseRenewalManager</code> | |
argument. If the value of the argument is <code>null</code>, an instance | |
of the <code>LeaseRenewalManager</code> class will be created, initially | |
managing no <code>Lease</code> objects.</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - because construction of a | |
<code>ServiceDiscoveryManager</code> may initiate the multicast discovery | |
process which can throw an <code>IOException</code>.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery"><code>DiscoveryManagement</code></a>, | |
<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event"><code>RemoteEventListener</code></a>, | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="ServiceDiscoveryManager-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-net.jini.config.Configuration-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>ServiceDiscoveryManager</h4> | |
<pre>public ServiceDiscoveryManager(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr, | |
<a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a> config) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, | |
<a href="../../../net/jini/config/ConfigurationException.html" title="class in net.jini.config">ConfigurationException</a></pre> | |
<div class="block">Constructs an instance of this class, which is configured using the items | |
retrieved through the given <code>Configuration</code>, that will, on | |
behalf of the entity that constructs this class, discover and manage a | |
set of lookup services, as well as discover and manage sets of services | |
registered with those lookup services. Through the parameters input to | |
this constructor, the client of this utility indicates which lookup | |
services to discover and manage, and how it wants the utility | |
additionally configured. | |
<p> | |
For a more details, refer to the description of the alternate constructor | |
of this class. | |
<p> | |
This constructor takes three arguments: an object that implements the | |
<code>DiscoveryManagement</code> interface, a reference to an instance of | |
the <code>LeaseRenewalManager</code> class, and a | |
<code>Configuration</code> object. The constructor throws an | |
<code>IOException</code> because construction of a | |
<code>ServiceDiscoveryManager</code> may initiate the multicast discovery | |
process, a process that can throw an <code>IOException</code>. The | |
constructor also throws a <code>ConfigurationException</code> when an | |
exception occurs while retrieving an item from the given | |
<code>Configuration</code></div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>discoveryMgr</code> - the <code>DiscoveryManagement</code> implementation | |
through which notifications that indicate a lookup service has been | |
discovered or discarded will be received. If the value of the argument is | |
<code>null</code>, then an instance of the | |
<code>LookupDiscoveryManager</code> utility class will be constructed to | |
listen for events announcing the discovery of only those lookup services | |
that are members of the public group.</dd> | |
<dd><code>leaseMgr</code> - the <code>LeaseRenewalManager</code> to use. A value of | |
<code>null</code> may be passed as the <code>LeaseRenewalManager</code> | |
argument. If the value of the argument is <code>null</code>, an instance | |
of the <code>LeaseRenewalManager</code> class will be created, initially | |
managing no <code>Lease</code> objects.</dd> | |
<dd><code>config</code> - the <code>Configuration</code></dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - because construction of a | |
<code>ServiceDiscoveryManager</code> may initiate the multicast discovery | |
process which can throw an <code>IOException</code>.</dd> | |
<dd><code><a href="../../../net/jini/config/ConfigurationException.html" title="class in net.jini.config">ConfigurationException</a></code> - indicates an exception | |
occurred while retrieving an item from the given | |
<code>Configuration</code></dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>null</code> is input for | |
the configuration</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery"><code>DiscoveryManagement</code></a>, | |
<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event"><code>RemoteEventListener</code></a>, | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup"><code>ServiceRegistrar</code></a>, | |
<a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config"><code>Configuration</code></a>, | |
<a href="../../../net/jini/config/ConfigurationException.html" title="class in net.jini.config"><code>ConfigurationException</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="ServiceDiscoveryManager-net.jini.lookup.ServiceDiscoveryManager.Initializer-"> | |
<!-- --> | |
</a> | |
<ul class="blockListLast"> | |
<li class="blockList"> | |
<h4>ServiceDiscoveryManager</h4> | |
<pre>private ServiceDiscoveryManager(<a href="../../../net/jini/lookup/ServiceDiscoveryManager.Initializer.html" title="class in net.jini.lookup">ServiceDiscoveryManager.Initializer</a> init)</pre> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
<!-- ============ METHOD DETAIL ========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="method.detail"> | |
<!-- --> | |
</a> | |
<h3>Method Detail</h3> | |
<a name="cacheAddProxy-net.jini.lookup.ServiceDiscoveryManager.ProxyReg-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>cacheAddProxy</h4> | |
<pre>private void cacheAddProxy(<a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a> reg)</pre> | |
<div class="block">Adds the given proxy to all the caches maintained by the SDM.</div> | |
</li> | |
</ul> | |
<a name="dropProxy-net.jini.lookup.ServiceDiscoveryManager.ProxyReg-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>dropProxy</h4> | |
<pre>private void dropProxy(<a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a> reg)</pre> | |
<div class="block">Removes the given proxy from all the caches maintained by the SDM.</div> | |
</li> | |
</ul> | |
<a name="buildServiceRegistrar--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>buildServiceRegistrar</h4> | |
<pre>private <a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a>[] buildServiceRegistrar()</pre> | |
<div class="block">Returns array of ServiceRegistrar created from the proxyRegSet</div> | |
</li> | |
</ul> | |
<a name="lookup-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>lookup</h4> | |
<pre>public <a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a> lookup(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</pre> | |
<div class="block">Queries each available lookup service in the set of lookup services | |
managed by the <code>ServiceDiscoveryManager</code> (the <i>managed | |
set</i>) for a service reference that matches criteria defined by the | |
entity that invokes this method. The semantics of this method are similar | |
to the semantics of the <code>lookup</code> method provided by the | |
<code>ServiceRegistrar</code> interface; employing the same | |
template-matching scheme. Additionally, this method allows any entity to | |
supply an object referred to as a <i>filter</i>. Such an object is a | |
non-remote object that defines additional matching criteria that the | |
<code>ServiceDiscoveryManager</code> applies when searching for the | |
entity's services of interest. This filtering facility is particularly | |
useful to entities that wish to extend the capabilities of standard | |
template-matching. | |
<p> | |
Entities typically employ this method when they need infrequent access to | |
services, and when the cost of making remote queries is outweighed by the | |
overhead of maintaining a local cache (for example, because of resource | |
limitations). | |
<p> | |
This version of <code>lookup</code> returns a <i>single</i> instance of | |
<code>ServiceItem</code> corresponding to one of possibly many service | |
references that satisfy the matching criteria. If multiple services | |
matching the input criteria happen to exist, it is arbitrary as to which | |
reference is actually returned. It is for this reason that entities that | |
invoke this method typically care only that <i>a</i> | |
service is returned, not <i>which</i> service. | |
<p> | |
Note that, unlike other versions of <code>lookup</code> provided by the | |
<code>ServiceDiscoveryManager</code>, this version does not | |
<i>block</i>. That is, this version will return immediately upon failure | |
(or success) to find a service matching the input criteria. | |
It is important to understand this characteristic because there is a | |
common usage scenario that can cause confusion when this version of | |
<code>lookup</code> is used but fails to discover the expected service of | |
interest. Suppose an entity creates a service discovery manager and then | |
immediately calls this version of <code>lookup</code>, which simply | |
queries the currently discovered lookup services for the service of | |
interest. If the discovery manager employed by the service discovery | |
manager has not yet disovered any lookup services (thus, there are no | |
lookup services to query) the method will immediately return a value of | |
<code>null</code>. This can be confusing when one verifies that such a | |
service of interest has indeed been started and registered with the | |
existing lookup service(s). To address this issue, one of the blocking | |
versions of <code>lookup</code> could be used instead of this version, or | |
the entity could simply wait until the discovery manager has been given | |
enough time to complete its own (lookup) discovery processing.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>tmpl</code> - an instance of <code>ServiceTemplate</code> corresponding to | |
the object to use for template-matching when searching for desired | |
services. If <code>null</code> is input to this parameter, this method | |
will use a <i>wildcarded</i> | |
template (will match all services) when performing template-matching. | |
Note that the effects of modifying contents of this parameter before this | |
method returns are unpredictable and undefined.</dd> | |
<dd><code>filter</code> - an instance of <code>ServiceItemFilter</code> containing | |
matching criteria that should be applied in addition to the | |
template-matching employed when searching for desired services. If | |
<code>null</code> is input to this parameter, then only template-matching | |
will be employed to find the desired services.</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>a single instance of <code>ServiceItem</code> corresponding to a | |
reference to a service that matches the criteria represented in the input | |
parameters; or <code>null</code> if no matching service can be found. | |
Note that if multiple services matching the input criteria exist, it is | |
arbitrary as to which reference is returned.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/core/lookup/ServiceRegistrar.html#lookup-net.jini.core.lookup.ServiceTemplate-"><code>ServiceRegistrar.lookup(net.jini.core.lookup.ServiceTemplate)</code></a>, | |
<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup"><code>ServiceTemplate</code></a>, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup"><code>ServiceItemFilter</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="lookup-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-long-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>lookup</h4> | |
<pre>public <a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a> lookup(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
long waitDur) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a>, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Queries each available lookup service in the managed set for a service | |
that matches the input criteria. The semantics of this method are similar | |
to the semantics of the <code>lookup</code> method provided by the | |
<code>ServiceRegistrar</code> interface; employing the same | |
template-matching scheme. Additionally, this method allows any entity to | |
supply an object referred to as a <i>filter</i>. Such an object is a | |
non-remote object that defines additional matching criteria that the | |
<code>ServiceDiscoveryManager</code> applies when searching for the | |
entity's services of interest. This filtering facility is particularly | |
useful to entities that wish to extend the capabilities of standard | |
template-matching. | |
<p> | |
This version of <code>lookup</code> returns a <i>single</i> instance of | |
<code>ServiceItem</code> corresponding to one of possibly many service | |
references that satisfy the matching criteria. If multiple services | |
matching the input criteria happen to exist, it is arbitrary as to which | |
reference is actually returned. It is for this reason that entities that | |
invoke this method typically care only that <i>a</i> | |
service is returned, not <i>which</i> service. | |
<p> | |
Note that this version of <code>lookup</code> provides a | |
<i>blocking</i> feature that is controlled through the | |
<code>waitDur</code> parameter. That is, this version will not return | |
until either a service that matches the input criteria has been found, or | |
the amount of time contained in the <code>waitDur</code> parameter has | |
passed. If, while waiting for the service of interest to be found, the | |
entity decides that it no longer wishes to wait the entire period for | |
this method to return, the entity may interrupt this method by invoking | |
the interrupt method from the <code>Thread</code> class. The intent of | |
this mechanism is to allow the entity to interrupt this method in the | |
same way it would a sleeping thread. | |
<p> | |
Entities typically employ this method when they need infrequent access to | |
services, are willing (or forced) to wait for those services to be found, | |
and consider the cost of making remote queries for those services is | |
outweighed by the overhead of maintaining a local cache (for example, | |
because of resource limitations).</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>tmpl</code> - an instance of <code>ServiceTemplate</code> corresponding to | |
the object to use for template-matching when searching for desired | |
services. If <code>null</code> is input to this parameter, this method | |
will use a <i>wildcarded</i> | |
template (will match all services) when performing template-matching. | |
Note that the effects of modifying contents of this parameter before this | |
method returns are unpredictable and undefined.</dd> | |
<dd><code>filter</code> - an instance of <code>ServiceItemFilter</code> containing | |
matching criteria that should be applied in addition to the | |
template-matching employed when searching for desired services. If | |
<code>null</code> is input to this parameter, then only template-matching | |
will be employed to find the desired services.</dd> | |
<dd><code>waitDur</code> - the amount of time (in milliseconds) to wait before ending | |
the "search" and returning <code>null</code>. If a non-positive value is | |
input to this parameter, then this method will not wait; it will simply | |
query the available lookup services and return a matching service | |
reference or <code>null</code>.</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>a single instance of <code>ServiceItem</code> corresponding to a | |
reference to a service that matches the criteria represented in the input | |
parameters; or <code>null</code> if no matching service can be found. | |
Note that if multiple services matching the input criteria exist, it is | |
arbitrary as to which reference is returned.</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - this exception occurs when the | |
entity interrupts this method by invoking the interrupt method from the | |
<code>Thread</code> class.</dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - typically, this exception occurs when a | |
RemoteException occurs either as a result of an attempt to export a | |
remote listener, or an attempt to register with the event mechanism of a | |
lookup service.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/core/lookup/ServiceRegistrar.html#lookup-net.jini.core.lookup.ServiceTemplate-"><code>ServiceRegistrar.lookup(net.jini.core.lookup.ServiceTemplate)</code></a>, | |
<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup"><code>ServiceTemplate</code></a>, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup"><code>ServiceItemFilter</code></a>, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html?is-external=true" title="class or interface in java.lang"><code>Thread</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="createLookupCache-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-net.jini.lookup.ServiceDiscoveryListener-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>createLookupCache</h4> | |
<pre>public <a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup">LookupCache</a> createLookupCache(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
<a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup">ServiceDiscoveryListener</a> listener) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">The <code>createLookupCache</code> method allows the client-like entity | |
to request that the <code>ServiceDiscoveryManager</code> create a new | |
managed set (or cache) and populate it with services, which match | |
criteria defined by the entity, and whose references are registered with | |
one or more of the lookup services the entity has targeted for discovery. | |
<p> | |
This method returns an object of type <code>LookupCache</code>. Through | |
this return value, the entity can query the cache for services of | |
interest, manage the cache's event mechanism for service discoveries, or | |
terminate the cache. | |
<p> | |
An entity typically uses the object returned by this method to provide | |
local storage of, and access to, references to services that it is | |
interested in using. Entities needing frequent access to numerous | |
services will find the object returned by this method quite useful | |
because acquisition of those service references is provided through local | |
method invocations. Additionally, because the object returned by this | |
method provides an event mechanism, it is also useful to entities wishing | |
to simply monitor, in an event-driven manner, the state changes that | |
occur in the services of interest. | |
<p> | |
Although not required, a common usage pattern for entities that wish to | |
use the <code>LookupCache</code> class to store and manage "discovered" | |
services is to create a separate cache for each service type of interest.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>tmpl</code> - template to match. It uses template-matching semantics to | |
identify the service(s) to acquire from lookup services in the managed | |
set. If this value is <code>null</code>, it is the equivalent of passing | |
a <code>ServiceTemplate</code> constructed with all <code>null</code> | |
arguments (all wildcards).</dd> | |
<dd><code>filter</code> - used to apply additional matching criteria to any | |
<code>ServiceItem</code> found through template-matching. If this value | |
is <code>null</code>, no additional filtering will be applied beyond the | |
template-matching.</dd> | |
<dd><code>listener</code> - object that will receive notifications when services | |
matching the input criteria are discovered for the first time, or have | |
encountered a state change such as removal from all lookup services or | |
attribute set changes. If this value is <code>null</code>, the cache | |
resulting from that invocation will send no such notifications.</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>LookupCache used to query the cache for services of interest, | |
manage the cache's event mechanism for service discoveries, or terminate | |
the cache.</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - typically, this exception occurs when a | |
RemoteException occurs as a result of an attempt to export the remote | |
listener that receives service events from the lookup services in the | |
managed set.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup"><code>ServiceItemFilter</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="getDiscoveryManager--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>getDiscoveryManager</h4> | |
<pre>public <a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> getDiscoveryManager()</pre> | |
<div class="block">The <code>getDiscoveryManager</code> method will return an object that | |
implements the <code>DiscoveryManagement</code> interface. The object | |
returned by this method provides the <code>ServiceDiscoveryManager</code> | |
with the ability to set discovery listeners and to discard previously | |
discovered lookup services when they are found to be unavailable.</div> | |
<dl> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>DiscoveryManagement implementation</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery"><code>DiscoveryManagement</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="getLeaseRenewalManager--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>getLeaseRenewalManager</h4> | |
<pre>public <a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> getLeaseRenewalManager()</pre> | |
<div class="block">The <code>getLeaseRenewalManager</code> method will return an instance of | |
the <code>LeaseRenewalManager</code> class. The object returned by this | |
method manages the leases requested and held by the | |
<code>ServiceDiscoveryManager</code>. In general, these leases correspond | |
to the registrations made by the <code>ServiceDiscoveryManager</code> | |
with the event mechanism of each lookup service in the managed set.</div> | |
<dl> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>LeaseRenewalManager for this instance of the | |
<code>ServiceDiscoveryManager</code>.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease"><code>LeaseRenewalManager</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="terminate--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>terminate</h4> | |
<pre>public void terminate()</pre> | |
<div class="block">The <code>terminate</code> method performs cleanup duties related to the | |
termination of the event mechanism for lookup service discovery, the | |
event mechanism for service discovery, and the cache management duties of | |
the <code>ServiceDiscoveryManager</code>. | |
<p> | |
For each instance of <code>LookupCache</code> created and managed by the | |
<code>ServiceDiscoveryManager</code>, the <code>terminate</code> method | |
will do the following: | |
<ul> | |
<li>Either remove all listener objects registered for receipt of | |
<code>DiscoveryEvent</code> objects or, if the discovery manager employed | |
by the <code>ServiceDiscoveryManager</code> was created by the | |
<code>ServiceDiscoveryManager</code> itself, terminate all discovery | |
processing being performed by that manager object on behalf of the | |
entity. | |
<p> | |
<li>Cancel all event leases granted by each lookup service in the managed | |
set of lookup services. | |
<p> | |
<li>Un-export all remote listener objects registered with each lookup | |
service in the managed set. | |
<p> | |
<li>Terminate all threads involved in the process of retrieving and | |
storing references to discovered services of interest. | |
</ul> | |
Calling any method after the termination will result in an | |
<code>IllegalStateException</code>.</div> | |
<dl> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/lookup/LookupCache.html" title="interface in net.jini.lookup"><code>LookupCache</code></a>, | |
<a href="../../../net/jini/discovery/DiscoveryEvent.html" title="class in net.jini.discovery"><code>DiscoveryEvent</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="lookup-net.jini.core.lookup.ServiceTemplate-int-net.jini.lookup.ServiceItemFilter-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>lookup</h4> | |
<pre>public <a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a>[] lookup(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
int maxMatches, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</pre> | |
<div class="block">Queries each available lookup service in the managed set for service(s) | |
that match the input criteria. The semantics of this method are similar | |
to the semantics of the <code>lookup</code> method provided by the | |
<code>ServiceRegistrar</code> interface; employing the same | |
template-matching scheme. Additionally, this method allows any entity to | |
supply an object referred to as a <i>filter</i>. Such an object is a | |
non-remote object that defines additional matching criteria that the | |
<code>ServiceDiscoveryManager</code> applies when searching for the | |
entity's services of interest. This filtering facility is particularly | |
useful to entities that wish to extend the capabilities of standard | |
template-matching. | |
<p> | |
Entities typically employ this method when they need infrequent access to | |
multiple instances of services, and when the cost of making remote | |
queries is outweighed by the overhead of maintaining a local cache (for | |
example, because of resource limitations). | |
<p> | |
This version of <code>lookup</code> returns an <i>array</i> of instances | |
of <code>ServiceItem</code> in which each element corresponds to a | |
service reference that satisfies the matching criteria. The number of | |
elements in the returned set will be no greater than the value of the | |
<code>maxMatches</code> parameter, but may be less. | |
<p> | |
Note that this version of <code>lookup</code> does not provide a | |
<i>blocking</i> feature. That is, this version will return immediately | |
with whatever number of service references it can find, up to the number | |
indicated in the <code>maxMatches</code> parameter. If no services | |
matching the input criteria can be found on the first attempt, an empty | |
array is returned. | |
It is important to understand this characteristic because there is a | |
common usage scenario that can cause confusion when this version of | |
<code>lookup</code> is used but fails to discover any instances of the | |
expected service of interest. Suppose an entity creates a service | |
discovery manager and then immediately calls this version of | |
<code>lookup</code>, which simply queries the currently discovered lookup | |
services for the service of interest. If the discovery manager employed | |
by the service discovery manager has not yet discovered any lookup | |
services (thus, there are no lookup services to query) the method will | |
immediately return an empty array. This can be confusing when one | |
verifies that instance(s) of such a service of interest have indeed been | |
started and registered with the existing lookup service(s). To address | |
this issue, one of the blocking versions of <code>lookup</code> could be | |
used instead of this version, or the entity could simply wait until the | |
discovery manager has been given enough time to complete its own (lookup) | |
discovery processing.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>tmpl</code> - an instance of <code>ServiceTemplate</code> corresponding to | |
the object to use for template-matching when searching for desired | |
services. If <code>null</code> is input to this parameter, this method | |
will use a <i>wildcarded</i> template (will match all services) when | |
performing template-matching. Note that the effects of modifying contents | |
of this parameter before this method returns are unpredictable and | |
undefined.</dd> | |
<dd><code>maxMatches</code> - this method will return no more than this number of | |
service references</dd> | |
<dd><code>filter</code> - an instance of <code>ServiceItemFilter</code> containing | |
matching criteria that should be applied in addition to the | |
template-matching employed when searching for desired services. If | |
<code>null</code> is input to this parameter, then only template-matching | |
will be employed to find the desired services.</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>an array of instances of <code>ServiceItem</code> where each | |
element corresponds to a reference to a service that matches the criteria | |
represented in the input parameters; or an empty array if no matching | |
service can be found.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/core/lookup/ServiceRegistrar.html#lookup-net.jini.core.lookup.ServiceTemplate-"><code>ServiceRegistrar.lookup(net.jini.core.lookup.ServiceTemplate)</code></a>, | |
<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup"><code>ServiceTemplate</code></a>, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup"><code>ServiceItemFilter</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="lookup-net.jini.core.lookup.ServiceTemplate-int-int-net.jini.lookup.ServiceItemFilter-long-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>lookup</h4> | |
<pre>public <a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a>[] lookup(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
int minMatches, | |
int maxMatches, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
long waitDur) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a>, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Queries each available lookup service in the managed set for service(s) | |
that match the input criteria. The semantics of this method are similar | |
to the semantics of the <code>lookup</code> method provided by the | |
<code>ServiceRegistrar</code> interface; employing the same | |
template-matching scheme. Additionally, this method allows any entity to | |
supply an object referred to as a <i>filter</i>. Such an object is a | |
non-remote object that defines additional matching criteria that the | |
<code>ServiceDiscoveryManager</code> applies when searching for the | |
entity's services of interest. This filtering facility is particularly | |
useful to entities that wish to extend the capabilities of standard | |
template-matching. | |
<p> | |
This version of <code>lookup</code> returns an <i>array</i> of instances | |
of <code>ServiceItem</code> in which each element corresponds to a | |
service reference that satisfies the matching criteria. The number of | |
elements in the returned set will be no greater than the value of the | |
<code>maxMatches</code> parameter, but may be less. | |
<p> | |
Note that this version of <code>lookup</code> provides a | |
<i>blocking</i> feature that is controlled through the | |
<code>waitDur</code> parameter in conjunction with the | |
<code>minMatches</code> and the <code>maxMatches</code> parameters. This | |
method will not return until one of the following occurs: | |
<p> | |
<ul> | |
<li> the number of matching services found on the first attempt is | |
greater than or equal to the value of the <code>minMatches</code> | |
parameter, in which case this method returns each of the services found | |
up to the value of the <code>maxMatches</code> parameter | |
<li> the number of matching services found <i>after</i> the first attempt | |
(that is, after the method enters the "wait state") is at least as great | |
as the value of the <code>minMatches</code> parameter in which case this | |
method returns each of the services found up to the value of the | |
<code>maxMatches</code> parameter | |
<li> the amount of time that has passed since this method entered the | |
wait state exceeds the value of the <code>waitDur</code> parameter, in | |
which case this method returns all of the currently discovered services | |
</ul> | |
<p> | |
The purpose of the <code>minMatches</code> parameter is to allow the | |
entity to balance its need for multiple matching service references with | |
its need to minimize the time spent in the wait state; time that most | |
would consider wasted if an acceptable number of matching service | |
references were found, but this method continued to wait until the end of | |
the designated time period. | |
<p> | |
If, while waiting for the minimum number of desired services to be | |
discovered, the entity decides that it no longer wishes to wait the | |
entire period for this method to return, the entity may interrupt this | |
method by invoking the interrupt method from the <code>Thread</code> | |
class. The intent of this mechanism is to allow the entity to interrupt | |
this method in the same way it would a sleeping thread. | |
<p> | |
Entities typically employ this method when they need infrequent access to | |
multiple instances of services, are willing (or forced) to wait for those | |
services to be found, and consider the cost of making remote queries for | |
those services is outweighed by the overhead of maintaining a local cache | |
(for example, because of resource limitations).</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>tmpl</code> - an instance of <code>ServiceTemplate</code> corresponding to | |
the object to use for template-matching when searching for desired | |
services. If <code>null</code> is input to this parameter, this method | |
will use a | |
<i>wildcarded</i> template (will match all services) when performing | |
template-matching. Note that the effects of modifying contents of this | |
parameter before this method returns are unpredictable and undefined.</dd> | |
<dd><code>minMatches</code> - this method will immediately exit the wait state and | |
return once this number of service references is found</dd> | |
<dd><code>maxMatches</code> - this method will return no more than this number of | |
service references</dd> | |
<dd><code>filter</code> - an instance of <code>ServiceItemFilter</code> containing | |
matching criteria that should be applied in addition to the | |
template-matching employed when searching for desired services. If | |
<code>null</code> is input to this parameter, then only template-matching | |
will be employed to find the desired services.</dd> | |
<dd><code>waitDur</code> - the amount of time (in milliseconds) to wait before ending | |
the "search" and returning an empty array. If a non-positive value is | |
input to this parameter, then this method will not wait; it will simply | |
query the available lookup services and return whatever matching service | |
reference(s) it could find, up to <code>maxMatches</code>.</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>an array of instances of <code>ServiceItem</code> where each | |
element corresponds to a reference to a service that matches the criteria | |
represented in the input parameters; or an empty array if no matching | |
service can be found within the time allowed.</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - this exception occurs when the | |
entity interrupts this method by invoking the interrupt method from the | |
<code>Thread</code> class.</dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - this exception occurs when one | |
of the following conditions is satisfied: | |
<p> | |
<ul> <li>the <code>minMatches</code> parameter is non-positive | |
<li>the <code>maxMatches</code> parameter is non-positive | |
<li>the value of <code>maxMatches</code> is <i>less than</i> | |
the value of <code>minMatches</code> | |
</ul></dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - typically, this exception occurs when a | |
RemoteException occurs either as a result of an attempt to export a | |
remote listener, or an attempt to register with the event mechanism of a | |
lookup service.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/core/lookup/ServiceRegistrar.html#lookup-net.jini.core.lookup.ServiceTemplate-"><code>ServiceRegistrar.lookup(net.jini.core.lookup.ServiceTemplate)</code></a>, | |
<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup"><code>ServiceTemplate</code></a>, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup"><code>ServiceItemFilter</code></a>, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html?is-external=true" title="class or interface in java.lang"><code>Thread</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="getMatchedServiceItem-net.jini.core.lookup.ServiceMatches-net.jini.lookup.ServiceItemFilter-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>getMatchedServiceItem</h4> | |
<pre>private <a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a> getMatchedServiceItem(<a href="../../../net/jini/core/lookup/ServiceMatches.html" title="class in net.jini.core.lookup">ServiceMatches</a> sm, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</pre> | |
<div class="block">From the given set of ServiceMatches, randomly selects and returns a | |
ServiceItem that matches the given filter (if applicable).</div> | |
</li> | |
</ul> | |
<a name="createLookupCache-net.jini.core.lookup.ServiceTemplate-net.jini.lookup.ServiceItemFilter-net.jini.lookup.ServiceDiscoveryListener-long-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>createLookupCache</h4> | |
<pre>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.LookupCacheImpl.html" title="class in net.jini.lookup">ServiceDiscoveryManager.LookupCacheImpl</a> createLookupCache(<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter, | |
<a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup">ServiceDiscoveryListener</a> listener, | |
long leaseDuration) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Creates a LookupCache with specific lease duration.</div> | |
<dl> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="removeReg-net.jini.core.lookup.ServiceRegistrar-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>removeReg</h4> | |
<pre>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.ProxyReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.ProxyReg</a> removeReg(<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy)</pre> | |
<div class="block">Removes and returns element from proxyRegSet that corresponds to the | |
given proxy.</div> | |
</li> | |
</ul> | |
<a name="fail-java.lang.Throwable-net.jini.core.lookup.ServiceRegistrar-java.lang.String-java.lang.String-java.lang.String-boolean-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>fail</h4> | |
<pre>private void fail(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a> e, | |
<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sourceClass, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sourceMethod, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> msg, | |
boolean cacheTerminated)</pre> | |
<div class="block">Convenience method invoked when failure occurs in the cache tasks | |
executed in this utility. If the appropriate logging level is enabled, | |
this method will log the stack trace of the given <code>Throwable</code>; | |
noting the given source class and method, and displaying the given | |
message. Additionally, this method will discard the given lookup service | |
proxy. Note that if the utility itself has already been terminated, or if | |
the cache in which the failure occurred has been terminated, then the | |
failure is logged at the HANDLED level, and the lookup service proxy is | |
not discarded. | |
Also, note that if the discovery manager employed by this utility has | |
already been terminated, then the attempt to discard the given lookup | |
service proxy will result in an <code>IllegalStateException</code>. Since | |
this method is called from within the tasks run by this utility, and | |
since propagating an <code>IllegalStateException</code> out into the | |
ThreadGroup of those tasks is undesirable, this method does not propagate | |
<code>IllegalStateException</code>s that occur as a result of an attempt | |
to discard a lookup service proxy from the discovery manager. | |
For more information, refer to Bug 4490358 and 4858211.</div> | |
</li> | |
</ul> | |
<a name="discard-net.jini.core.lookup.ServiceRegistrar-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>discard</h4> | |
<pre>private void discard(<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy)</pre> | |
<div class="block">Discards a ServiceRegistrar through the discovery manager.</div> | |
</li> | |
</ul> | |
<a name="cancelLease-net.jini.core.lease.Lease-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>cancelLease</h4> | |
<pre>private void cancelLease(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> lease)</pre> | |
<div class="block">Cancels the given event lease.</div> | |
</li> | |
</ul> | |
<a name="registerListener-net.jini.core.lookup.ServiceRegistrar-net.jini.core.lookup.ServiceTemplate-net.jini.core.event.RemoteEventListener-long-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>registerListener</h4> | |
<pre>private <a href="../../../net/jini/lookup/ServiceDiscoveryManager.EventReg.html" title="class in net.jini.lookup">ServiceDiscoveryManager.EventReg</a> registerListener(<a href="../../../net/jini/core/lookup/ServiceRegistrar.html" title="interface in net.jini.core.lookup">ServiceRegistrar</a> proxy, | |
<a href="../../../net/jini/core/lookup/ServiceTemplate.html" title="class in net.jini.core.lookup">ServiceTemplate</a> tmpl, | |
<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event">RemoteEventListener</a> listenerProxy, | |
long duration) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Registers for events from the lookup service associated with the given | |
proxy, and returns both the lease and the event sequence number from the | |
event registration wrapped in the locally-defined class, | |
<code>EventReg</code>. | |
This method is called from the <code>RegisterListenerTask</code>. If a | |
<code>RemoteException</code> occurs during the event registration | |
attempt, this method discards the lookup service and returns | |
<code>null</code>.</div> | |
<dl> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="checkTerminated--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>checkTerminated</h4> | |
<pre>private void checkTerminated()</pre> | |
<div class="block">Throws an IllegalStateException if the current instance of the | |
ServiceDiscoveryManager has been terminated.</div> | |
</li> | |
</ul> | |
<a name="isArrayContainsServiceItem-java.util.List-net.jini.core.lookup.ServiceItem-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>isArrayContainsServiceItem</h4> | |
<pre>private static boolean isArrayContainsServiceItem(<a href="http://docs.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a>> a, | |
<a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a> s)</pre> | |
<div class="block">Determines if the given ServiceItem is an element of the given array.</div> | |
</li> | |
</ul> | |
<a name="initial-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-net.jini.config.Configuration-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>initial</h4> | |
<pre>private static <a href="../../../net/jini/lookup/ServiceDiscoveryManager.Initializer.html" title="class in net.jini.lookup">ServiceDiscoveryManager.Initializer</a> initial(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr, | |
<a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a> config) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> | |
<dl> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="init-net.jini.discovery.DiscoveryManagement-net.jini.lease.LeaseRenewalManager-net.jini.config.Configuration-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>init</h4> | |
<pre>private static <a href="../../../net/jini/lookup/ServiceDiscoveryManager.Initializer.html" title="class in net.jini.lookup">ServiceDiscoveryManager.Initializer</a> init(<a href="../../../net/jini/discovery/DiscoveryManagement.html" title="interface in net.jini.discovery">DiscoveryManagement</a> discoveryMgr, | |
<a href="../../../net/jini/lease/LeaseRenewalManager.html" title="class in net.jini.lease">LeaseRenewalManager</a> leaseMgr, | |
<a href="../../../net/jini/config/Configuration.html" title="interface in net.jini.config">Configuration</a> config) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, | |
<a href="../../../net/jini/config/ConfigurationException.html" title="class in net.jini.config">ConfigurationException</a></pre> | |
<dl> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> | |
<dd><code><a href="../../../net/jini/config/ConfigurationException.html" title="class in net.jini.config">ConfigurationException</a></code></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="filterPassed-net.jini.core.lookup.ServiceItem-net.jini.lookup.ServiceItemFilter-"> | |
<!-- --> | |
</a> | |
<ul class="blockListLast"> | |
<li class="blockList"> | |
<h4>filterPassed</h4> | |
<pre>private boolean filterPassed(<a href="../../../net/jini/core/lookup/ServiceItem.html" title="class in net.jini.core.lookup">ServiceItem</a> item, | |
<a href="../../../net/jini/lookup/ServiceItemFilter.html" title="interface in net.jini.lookup">ServiceItemFilter</a> filter)</pre> | |
<div class="block">Applies the given <code>filter</code> to the given <code>item</code>, and | |
returns <code>true</code> if the <code>filter</code> returns a | |
<code>pass</code> value; otherwise, returns <code>false</code>. | |
<p> | |
Note that as described in the specification of | |
<code>ServiceItemFilter</code>, when the <code>item</code> passes the | |
<code>filter</code>, the <code>service</code> field of the | |
<code>item</code> is replaced with the filtered form of the object | |
previously contained in that field. Additionally, if the | |
<code>filter</code> returns <code>indefinite</code>, then as specified, | |
the <code>service</code> field is replaced with <code>null</code> (in | |
which case, this method returns <code>false</code>). | |
<p> | |
This method is used by the non-blocking version(s) of the | |
<code>lookup</code> method of the <code>ServiceDiscoveryManager</code>, | |
as well as when second-stage filtering is performed in the | |
<code>LookupCache</code>.</div> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
</div> | |
<!-- ========= END OF CLASS DATA ========= --> | |
<!-- ======= START OF BOTTOM NAVBAR ====== --> | |
<div class="bottomNav"><a name="navbar.bottom"> | |
<!-- --> | |
</a> | |
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> | |
<a name="navbar.bottom.firstrow"> | |
<!-- --> | |
</a> | |
<ul class="navList" title="Navigation"> | |
<li><a href="../../../overview-summary.html">Overview</a></li> | |
<li><a href="package-summary.html">Package</a></li> | |
<li class="navBarCell1Rev">Class</li> | |
<li><a href="class-use/ServiceDiscoveryManager.html">Use</a></li> | |
<li><a href="package-tree.html">Tree</a></li> | |
<li><a href="../../../deprecated-list.html">Deprecated</a></li> | |
<li><a href="../../../index-all.html">Index</a></li> | |
<li><a href="../../../help-doc.html">Help</a></li> | |
</ul> | |
</div> | |
<div class="subNav"> | |
<ul class="navList"> | |
<li><a href="../../../net/jini/lookup/ServiceDiscoveryListener.html" title="interface in net.jini.lookup"><span class="typeNameLink">Prev Class</span></a></li> | |
<li><a href="../../../net/jini/lookup/ServiceDiscoveryManager.CacheTask.html" title="class in net.jini.lookup"><span class="typeNameLink">Next Class</span></a></li> | |
</ul> | |
<ul class="navList"> | |
<li><a href="../../../index.html?net/jini/lookup/ServiceDiscoveryManager.html" target="_top">Frames</a></li> | |
<li><a href="ServiceDiscoveryManager.html" target="_top">No Frames</a></li> | |
</ul> | |
<ul class="navList" id="allclasses_navbar_bottom"> | |
<li><a href="../../../allclasses-noframe.html">All Classes</a></li> | |
</ul> | |
<div> | |
<script type="text/javascript"><!-- | |
allClassesLink = document.getElementById("allclasses_navbar_bottom"); | |
if(window==top) { | |
allClassesLink.style.display = "block"; | |
} | |
else { | |
allClassesLink.style.display = "none"; | |
} | |
//--> | |
</script> | |
</div> | |
<div> | |
<ul class="subNavList"> | |
<li>Summary: </li> | |
<li><a href="#nested.class.summary">Nested</a> | </li> | |
<li><a href="#field.summary">Field</a> | </li> | |
<li><a href="#constructor.summary">Constr</a> | </li> | |
<li><a href="#method.summary">Method</a></li> | |
</ul> | |
<ul class="subNavList"> | |
<li>Detail: </li> | |
<li><a href="#field.detail">Field</a> | </li> | |
<li><a href="#constructor.detail">Constr</a> | </li> | |
<li><a href="#method.detail">Method</a></li> | |
</ul> | |
</div> | |
<a name="skip.navbar.bottom"> | |
<!-- --> | |
</a></div> | |
<!-- ======== END OF BOTTOM NAVBAR ======= --> | |
<p class="legalCopy"><small>Copyright 2007-2013, multiple authors.<br>Licensed under the <a href=http://www.apache.org/licenses/LICENSE-2.0 target=child >Apache License, Version 2.0</a>, see the <a href=../../../doc-files/NOTICE target=child >NOTICE</a> file for attributions.</small></p> | |
</body> | |
</html> |