public final class RmiServerImpl extends UnicastRemoteObject implements RmiServer
ref
DEFAULT_RMI_PORT
Constructor and Description |
---|
RmiServerImpl() |
RmiServerImpl(int port) |
RmiServerImpl(String hostName,
int port) |
RmiServerImpl(String hostName,
int port,
String remoteHostName,
int remotePort) |
Modifier and Type | Method and Description |
---|---|
void |
addTrigger(ConnectTrigger trigger) |
<T> T |
getObject(Class<T> type)
根据类型获取对象
|
<T> T |
getObject(String name)
返回对象
|
<T> List<T> |
getObjectList(Class<T> type)
根据类型返回对象列表
|
<T> List<T> |
getObjectList(String typeName)
根据类型返回对象列表
|
Registry |
getRegistry()
返回本地对象注册表
|
<T> List<T> |
getRemoteObjectListInstanceOf(Class<T> type) |
Registry |
getRemoteRegistry() |
void |
registerLocalObject(Remote object,
Class type)
按类型名称注册本地对象,如果此类型已经存在对象,则已经存在的对象将被替换
|
void |
registerLocalObject(Remote object,
Class type,
String id)
注册本地对象,类型及ID
|
void |
registerLocalObject(Remote object,
String name)
注册本地对象,类型及ID
|
void |
registerLocalObject(Remote object,
String type,
String id)
注册本地对象,类型及ID
|
void |
registerRemoteObject(Remote object,
Class type)
按类型名称注册远程对象,在Server中仅仅将该对象存放在内存map中,如果此类型已经存在对象,则已经存在的对象将被替换
|
void |
registerRemoteObject(Remote object,
Class type,
String id)
注册远程对象,类型及ID,在Server中仅仅将该对象存放在内存map中
|
void |
registerRemoteObject(Remote object,
String name)
注册远程对象,类型及ID,在Server中仅仅将该对象存放在内存map中
|
void |
registerRemoteObject(Remote object,
String type,
String id)
注册远程对象,类型及ID,在Server中仅仅将该对象存放在内存map中
|
void |
stop()
停止RMIServer
|
void |
stopLocalRegistry() |
void |
unexportObjects()
停止所有提供远程访问的对象
|
void |
unregisterObject(Class type,
String id)
根据类型注销对象
|
void |
unregisterObject(Remote object)
停止具体的注册在此远程服务中心的本地对象
|
void |
unregisterObject(String name)
根据名称注销对象
|
void |
unregisterObject(String type,
String id)
根据类型注销对象
|
void |
unregisterObjectByType(Class type)
根据类型注销对象
|
void |
unregisterObjectByType(String type)
根据类型注销对象
|
clone, exportObject, exportObject, exportObject, unexportObject
getClientHost, getLog, setLog
public RmiServerImpl() throws RemoteException
RemoteException
public RmiServerImpl(int port) throws RemoteException
RemoteException
public RmiServerImpl(String hostName, int port) throws RemoteException
RemoteException
public RmiServerImpl(String hostName, int port, String remoteHostName, int remotePort) throws RemoteException
RemoteException
public Registry getRegistry() throws RemoteException
RmiServer
getRegistry
in interface RmiServer
RemoteException
public Registry getRemoteRegistry() throws RemoteException
RemoteException
public void stop() throws RemoteException
RmiServer
stop
in interface RmiServer
RemoteException
public void stopLocalRegistry() throws RemoteException
RemoteException
public void addTrigger(ConnectTrigger trigger) throws RemoteException
addTrigger
in interface RmiServer
RemoteException
public void registerLocalObject(Remote object, String name) throws RemoteException
RmiServer
registerLocalObject
in interface RmiServer
name
- 名字如果重复,已经存在的对象将被替换,全局唯一RemoteException
public void registerLocalObject(Remote object, Class type, String id) throws RemoteException
RmiServer
registerLocalObject
in interface RmiServer
type
- 注册的对象类型,可以重复id
- 注册的对象的ID,相同类型不可以重复,不同类型可以重复RemoteException
public void registerLocalObject(Remote object, String type, String id) throws RemoteException
RmiServer
registerLocalObject
in interface RmiServer
type
- 注册的对象类型,可以重复id
- 注册的对象的ID,相同类型不可以重复,不同类型可以重复RemoteException
public void registerLocalObject(Remote object, Class type) throws RemoteException
RmiServer
registerLocalObject
in interface RmiServer
RemoteException
public void registerRemoteObject(Remote object, Class type, String id) throws RemoteException
RmiServer
registerRemoteObject
in interface RmiServer
type
- 注册的远程对象类型,可以重复id
- 注册的远程对象的ID,相同类型不可以重复,不同类型可以重复RemoteException
public void registerRemoteObject(Remote object, String type, String id) throws RemoteException
RmiServer
registerRemoteObject
in interface RmiServer
type
- 注册的对象类型,可以重复id
- 注册的对象的ID,相同类型不可以重复,不同类型可以重复RemoteException
public void registerRemoteObject(Remote object, String name) throws RemoteException
RmiServer
registerRemoteObject
in interface RmiServer
name
- 名字如果重复,已经存在的对象将被替换,全局唯一RemoteException
public void registerRemoteObject(Remote object, Class type) throws RemoteException
RmiServer
registerRemoteObject
in interface RmiServer
RemoteException
public void unregisterObject(Remote object) throws RemoteException
RmiServer
unregisterObject
in interface RmiServer
RemoteException
public void unregisterObject(String name) throws RemoteException
RmiServer
unregisterObject
in interface RmiServer
name
- 要注销的对象名RemoteException
public void unregisterObjectByType(Class type) throws RemoteException
RmiServer
unregisterObjectByType
in interface RmiServer
type
- 要注销的对象类型,所有匹配的对象都会被注销RemoteException
public void unregisterObjectByType(String type) throws RemoteException
RmiServer
unregisterObjectByType
in interface RmiServer
RemoteException
public void unregisterObject(String type, String id) throws RemoteException
RmiServer
unregisterObject
in interface RmiServer
type
- 要注销的类型id
- 要注销的IDRemoteException
public void unregisterObject(Class type, String id) throws RemoteException
RmiServer
unregisterObject
in interface RmiServer
type
- 要注销的类型id
- 要注销的IDRemoteException
public <T> T getObject(String name) throws RemoteException
RmiServer
getObject
in interface RmiServer
RemoteException
public <T> T getObject(Class<T> type) throws RemoteException
RmiServer
getObject
in interface RmiServer
RemoteException
public <T> List<T> getObjectList(Class<T> type) throws RemoteException
RmiServer
getObjectList
in interface RmiServer
RemoteException
public <T> List<T> getObjectList(String typeName) throws RemoteException
RmiServer
getObjectList
in interface RmiServer
RemoteException
public <T> List<T> getRemoteObjectListInstanceOf(Class<T> type) throws RemoteException
getRemoteObjectListInstanceOf
in interface RmiServer
RemoteException
public void unexportObjects() throws RemoteException
RmiServer
unexportObjects
in interface RmiServer
RemoteException
Copyright © 2006–2018 TinyGroup. All rights reserved.