GigaSpaces XAP 9.7.2 API

com.sun.jini.reggie
Interface Registrar

All Superinterfaces:
Administrable, DestroyAdmin, DiscoveryAdmin, JoinAdmin, Remote, ServiceProxyAccessor
All Known Implementing Classes:
GigaRegistrar

public interface Registrar
extends Remote, ServiceProxyAccessor, Administrable, DiscoveryAdmin, JoinAdmin, DestroyAdmin

Registrar defines the private protocol between the various client-side proxies and the registrar server.

The declared methods are pretty straightforward transformations of the ServiceRegistrar and ServiceRegistration interfaces, with external classes (ServiceItem, ServiceTemplate, ServiceMatches, Entry) converted to internal classes (Item, Template, Matches, EntryRep). In addition, there are methods for transformed Lease and LeaseMap interfaces, for service and event leases.

Author:
Sun Microsystems, Inc.

Method Summary
 void addAttributes(ServiceID serviceID, Uuid leaseID, EntryRep[] attrSets)
          Adds the specified attribute sets (those that aren't duplicates of existing attribute sets) to the registered service item.
 void cancelEventLease(long eventID, Uuid leaseID)
          Cancels an event lease.
 Exception[] cancelLeases(Object[] regIDs, Uuid[] leaseIDs)
          Cancels service and event leases from a LeaseMap.
 void cancelServiceLease(ServiceID serviceID, Uuid leaseID)
          Cancels a service lease.
 EntryClassBase[] getEntryClasses(Template tmpl)
          Looks at all service items that match the specified template, finds every entry (among those service items) that either doesn't match any entry templates or is a subclass of at least one matching entry template, and returns the set of the (most specific) classes of those entries.
 Object[] getFieldValues(Template tmpl, int setIndex, int field)
          Looks at all service items that match the specified template, finds every entry (among those service items) that matches tmpl.attributeSetTemplates[setIndex], and returns the set of values of the specified field of those entries.
 LookupLocator getLocator()
          Returns a LookupLocator that can be used if necessary for unicast discovery of the lookup service.
 ServiceTypeBase[] getServiceTypes(Template tmpl, String prefix)
          Looks at all service items that match the specified template, and for every service item finds the most specific type (class or interface) or types the service item is an instance of that are neither equal to, nor a superclass of, any of the service types in the template and that have names that start with the specified prefix, and returns the set of all such types.
 MarshalledWrapper lookup(Template tmpl)
          Returns the service object (i.e., just ServiceItem.service) from an item matching the template, or null if there is no match.
 Matches lookup(Template tmpl, int maxMatches)
          Returns at most maxMatches items matching the template, plus the total number of items that match the template.
 void modifyAttributes(ServiceID serviceID, Uuid leaseID, EntryRep[] attrSetTmpls, EntryRep[] attrSets)
          Modifies existing attribute sets of a registered service item.
 RegistrarEventRegistration notify(Template tmpl, int transitions, RemoteEventListener listener, MarshalledObject handback, long leaseDuration)
          Registers for event notification.
 RegistrarEventRegistration notify(Template tmpl, int transitions, RemoteEventListener listener, MarshalledObject handback, long leaseDuration, int notifyType)
          Registers for event notification.
 ServiceRegistration register(Item item, long leaseDuration)
          Register a new service or re-register an existing service.
 long renewEventLease(long eventID, Uuid leaseID, long duration)
          Renews an event lease.
 RenewResults renewLeases(Object[] regIDs, Uuid[] leaseIDs, long[] durations)
          Renews service and event leases from a LeaseMap.
 long renewServiceLease(ServiceID serviceID, Uuid leaseID, long duration)
          Renews a service lease.
 ServiceDetails serviceDetails(ServiceID serviceID)
          Returns the service details of the service id.
 void setAttributes(ServiceID serviceID, Uuid leaseID, EntryRep[] attrSets)
          Deletes all of the service item's existing attributes, and replaces them with the specified attribute sets.
 
Methods inherited from interface com.sun.jini.start.ServiceProxyAccessor
getServiceProxy
 
Methods inherited from interface net.jini.admin.Administrable
getAdmin
 
Methods inherited from interface net.jini.lookup.DiscoveryAdmin
addMemberGroups, getMemberGroups, getUnicastPort, removeMemberGroups, setMemberGroups, setUnicastPort
 
Methods inherited from interface net.jini.admin.JoinAdmin
addLookupAttributes, addLookupGroups, addLookupLocators, getLookupAttributes, getLookupGroups, getLookupLocators, modifyLookupAttributes, removeLookupGroups, removeLookupLocators, setLookupGroups, setLookupLocators
 
Methods inherited from interface com.sun.jini.admin.DestroyAdmin
destroy
 

Method Detail

register

ServiceRegistration register(Item item,
                             long leaseDuration)
                             throws RemoteException
Register a new service or re-register an existing service.

Throws:
RemoteException
See Also:
ServiceRegistrar.register(net.jini.core.lookup.ServiceItem, long)

serviceDetails

ServiceDetails serviceDetails(ServiceID serviceID)
                              throws RemoteException
Returns the service details of the service id.

Throws:
RemoteException

lookup

MarshalledWrapper lookup(Template tmpl)
                         throws RemoteException
Returns the service object (i.e., just ServiceItem.service) from an item matching the template, or null if there is no match.

Throws:
RemoteException
See Also:
ServiceRegistrar.lookup(net.jini.core.lookup.ServiceTemplate)

lookup

Matches lookup(Template tmpl,
               int maxMatches)
               throws RemoteException
Returns at most maxMatches items matching the template, plus the total number of items that match the template.

Throws:
RemoteException
See Also:
ServiceRegistrar.lookup(net.jini.core.lookup.ServiceTemplate)

notify

RegistrarEventRegistration notify(Template tmpl,
                                  int transitions,
                                  RemoteEventListener listener,
                                  MarshalledObject handback,
                                  long leaseDuration)
                                  throws RemoteException
Registers for event notification.

Throws:
RemoteException
See Also:
ServiceRegistrar.notify(net.jini.core.lookup.ServiceTemplate, int, net.jini.core.event.RemoteEventListener, java.rmi.MarshalledObject, long)

notify

RegistrarEventRegistration notify(Template tmpl,
                                  int transitions,
                                  RemoteEventListener listener,
                                  MarshalledObject handback,
                                  long leaseDuration,
                                  int notifyType)
                                  throws RemoteException
Registers for event notification.

Throws:
RemoteException
See Also:
ServiceRegistrar.notify(net.jini.core.lookup.ServiceTemplate, int, net.jini.core.event.RemoteEventListener, java.rmi.MarshalledObject, long)

getEntryClasses

EntryClassBase[] getEntryClasses(Template tmpl)
                                 throws RemoteException
Looks at all service items that match the specified template, finds every entry (among those service items) that either doesn't match any entry templates or is a subclass of at least one matching entry template, and returns the set of the (most specific) classes of those entries.

Throws:
RemoteException
See Also:
ServiceRegistrar.getEntryClasses(net.jini.core.lookup.ServiceTemplate)

getFieldValues

Object[] getFieldValues(Template tmpl,
                        int setIndex,
                        int field)
                        throws RemoteException
Looks at all service items that match the specified template, finds every entry (among those service items) that matches tmpl.attributeSetTemplates[setIndex], and returns the set of values of the specified field of those entries. The field name has been converted to an index (fields numbered from super to subclass).

Throws:
RemoteException
See Also:
ServiceRegistrar.getFieldValues(net.jini.core.lookup.ServiceTemplate, int, java.lang.String)

getServiceTypes

ServiceTypeBase[] getServiceTypes(Template tmpl,
                                  String prefix)
                                  throws RemoteException
Looks at all service items that match the specified template, and for every service item finds the most specific type (class or interface) or types the service item is an instance of that are neither equal to, nor a superclass of, any of the service types in the template and that have names that start with the specified prefix, and returns the set of all such types.

Throws:
RemoteException
See Also:
ServiceRegistrar.getServiceTypes(net.jini.core.lookup.ServiceTemplate, java.lang.String)

getLocator

LookupLocator getLocator()
                         throws RemoteException
Returns a LookupLocator that can be used if necessary for unicast discovery of the lookup service.

Throws:
RemoteException
See Also:
ServiceRegistrar.getLocator()

addAttributes

void addAttributes(ServiceID serviceID,
                   Uuid leaseID,
                   EntryRep[] attrSets)
                   throws UnknownLeaseException,
                          RemoteException
Adds the specified attribute sets (those that aren't duplicates of existing attribute sets) to the registered service item.

Throws:
UnknownLeaseException
RemoteException
See Also:
ServiceRegistration.addAttributes(net.jini.core.entry.Entry[])

modifyAttributes

void modifyAttributes(ServiceID serviceID,
                      Uuid leaseID,
                      EntryRep[] attrSetTmpls,
                      EntryRep[] attrSets)
                      throws UnknownLeaseException,
                             RemoteException
Modifies existing attribute sets of a registered service item.

Throws:
UnknownLeaseException
RemoteException
See Also:
ServiceRegistration.modifyAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])

setAttributes

void setAttributes(ServiceID serviceID,
                   Uuid leaseID,
                   EntryRep[] attrSets)
                   throws UnknownLeaseException,
                          RemoteException
Deletes all of the service item's existing attributes, and replaces them with the specified attribute sets.

Throws:
UnknownLeaseException
RemoteException
See Also:
ServiceRegistration.setAttributes(net.jini.core.entry.Entry[])

cancelServiceLease

void cancelServiceLease(ServiceID serviceID,
                        Uuid leaseID)
                        throws UnknownLeaseException,
                               RemoteException
Cancels a service lease.

Throws:
UnknownLeaseException
RemoteException
See Also:
Lease.cancel()

renewServiceLease

long renewServiceLease(ServiceID serviceID,
                       Uuid leaseID,
                       long duration)
                       throws UnknownLeaseException,
                              RemoteException
Renews a service lease.

Throws:
UnknownLeaseException
RemoteException
See Also:
Lease.renew(long)

cancelEventLease

void cancelEventLease(long eventID,
                      Uuid leaseID)
                      throws UnknownLeaseException,
                             RemoteException
Cancels an event lease.

Throws:
UnknownLeaseException
RemoteException
See Also:
Lease.cancel()

renewEventLease

long renewEventLease(long eventID,
                     Uuid leaseID,
                     long duration)
                     throws UnknownLeaseException,
                            RemoteException
Renews an event lease.

Throws:
UnknownLeaseException
RemoteException
See Also:
Lease.renew(long)

renewLeases

RenewResults renewLeases(Object[] regIDs,
                         Uuid[] leaseIDs,
                         long[] durations)
                         throws RemoteException
Renews service and event leases from a LeaseMap.

Throws:
RemoteException
See Also:
LeaseMap.renewAll()

cancelLeases

Exception[] cancelLeases(Object[] regIDs,
                         Uuid[] leaseIDs)
                         throws RemoteException
Cancels service and event leases from a LeaseMap.

Throws:
RemoteException
See Also:
LeaseMap.cancelAll()

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.