public class RegistryImpl extends UnicastRemoteObject implements Registry
Although the Registry implementation uses rmi underneath, the rmi registry is fully encapsulated inside the Registry and RegistryLocator to avoid any confusion in the agent programs and other programs accessing the registry.
ref
Modifier and Type | Method and Description |
---|---|
int |
getNumServices(String type)
Get the number of registered Services of a type.
|
Remote |
getService(String name)
get reference to service from Registry
The registry searches in its list of registered services
and returns a remote reference to the requested one.
|
Remote |
getService(String type,
String name)
get reference to service from Registry
The registry searches in its list of registered services
and returns a remote reference to the requested one.
|
Remote[] |
getServices(String type)
get all references to a type of services from Registry
The registry searches in its list of registered services
and returns all remote references to the requested type.
|
void |
kill()
Kill is called to exit the RMI registry and Registry.
|
static void |
main(String[] args)
Registration for RMI serving.
|
boolean |
register(String name,
Remote service)
Registers service with Registry.
|
boolean |
register(String type,
String name,
Remote service)
Registers service with Registry.
|
void |
reregister(String name,
Remote service)
Re-registers service with Registry, replacing old entry if exists.
|
void |
reregister(String type,
String name,
Remote service)
Re-registers service with Registry, replacing old entry if exists.
|
void |
unregister(String name)
unregister service from Registry
The registry removes this service from its list and clients
can no longer access it.
|
void |
unregister(String type,
String name)
unregister service from Registry
The registry removes this service from its list and clients
can no longer access it.
|
clone, exportObject, exportObject, exportObject, unexportObject
getClientHost, getLog, setLog
public boolean register(String name, Remote service)
public boolean register(String type, String name, Remote service)
public void reregister(String name, Remote service)
reregister
in interface Registry
name
- public driverName of serviceservice
- Remote reference to servicepublic void reregister(String type, String name, Remote service)
reregister
in interface Registry
type
- of servicename
- of serviceservice
- Remote reference to servicepublic void unregister(String name)
unregister
in interface Registry
name
- public driverName of servicepublic void unregister(String type, String name)
unregister
in interface Registry
type
- of servicename
- public driverName of servicepublic Remote getService(String name)
getService
in interface Registry
name
- public driverName of servicepublic Remote getService(String type, String name)
getService
in interface Registry
type
- of servicename
- public driverName of servicepublic Remote[] getServices(String type)
getServices
in interface Registry
type
- of servicepublic int getNumServices(String type)
getNumServices
in interface Registry
type
- of servicepublic void kill()
public static void main(String[] args)
args
- Command line arguments, not used