|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject charly.server.ChServerImpl
Implementation of the server interface. This is the central class of the
server-side part of Charly. It adds devices (such as
ChGpibDevice
) and the client starts
the communication to the server always via an object of this class.
See main(String [])
for calling details.
Field Summary | |
(package private) java.util.Hashtable |
Devices
Keys sind vom Typ String und enthalten den Namen des Devices in Großbuchstaben, Value-Elemente sind vom Typ ChDevice |
(package private) ChRsrcManager |
rsrcMgr
|
static java.lang.String |
title
|
Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
Fields inherited from class java.rmi.server.RemoteServer |
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
(package private) |
ChServerImpl()
|
Method Summary | |
void |
addDevice(ChDevice newDvc)
|
static void |
error(java.lang.String msg)
wird aufgerufen, wenn ein schwerer noch nicht behandelter Fehler im Programm auftritt |
ChDevice |
getDevice(java.lang.String dvcName)
returns the device by its name. |
ChRsrcManager |
getRsrcMgr()
initializes the internal ChRsrcManager , if not already done. |
void |
log(java.lang.Object src,
java.lang.String msg)
just a simple logging function which prints the msg to
System.out . |
static void |
main(java.lang.String[] args)
Calling ChServerImpl is quite complex because of the use of RMI.
|
static void |
printLocalAddress()
|
static void |
problem(java.lang.String msg)
wird aufgerufen, wenn ein Problem auftritt, durch das die Stabilität des Servers aber nicht beeinträchtigt wird |
(package private) void |
registryBind()
binds this to the local host - registry with the name "CharlyServer" |
void |
setRsrcMgr(ChRsrcManager rsrcMgr)
|
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String title
ChRsrcManager rsrcMgr
java.util.Hashtable Devices
ChDevice
Constructor Detail |
ChServerImpl() throws java.rmi.RemoteException
Method Detail |
public ChRsrcManager getRsrcMgr() throws java.rmi.RemoteException
ChRsrcManager
, if not already done.
getRsrcMgr
in interface ChServer
java.rmi.RemoteException
public void setRsrcMgr(ChRsrcManager rsrcMgr)
public static void main(java.lang.String[] args) throws java.lang.IllegalArgumentException, java.net.MalformedURLException, java.rmi.RemoteException
Calling ChServerImpl
is quite complex because of the use of RMI.
Before calling ChServerImpl
the RMI-registry has to be started
(in Windows: rmiregistry.exe
).
A policy file is needed. A very
simple policy file (ChPolicy) is joint with this distribution. It is not
safe to use this file, because it grants all permissions. On starting,
the property java.security.policy
must be set to the name of the
property file.
Charly has to be able to load some classes code to the RMI. That is why
a codebase has to be given. The property java.rmi.server.codebase
has to be set to the codebase (the directory or the JAR-file, but only one).
Device drivers are arguments for main. Device drivers have to implement
ChDevice
.
java -Djava.rmi.server.codebase=file:///H:/Java/classes/
-Djava.security.policy=H:\java\charly\ChPolicy charly.server.ChServerImpl
charly.server.ChGpibDevice
- Throws:
java.lang.IllegalArgumentException
- Diese Ausnahme dürfte nicht
auftreten: Tödlicher Fehler
java.net.MalformedURLException
java.rmi.RemoteException
- See Also:
ChGpibDevice
,
ChRobDevice
public void log(java.lang.Object src, java.lang.String msg)
msg
to
System.out
.
void registryBind() throws java.net.MalformedURLException, java.rmi.RemoteException, java.rmi.AccessException
this
to the local host - registry with the name "CharlyServer"
java.net.MalformedURLException
java.rmi.RemoteException
java.rmi.AccessException
public static void printLocalAddress()
public void addDevice(ChDevice newDvc)
public ChDevice getDevice(java.lang.String dvcName) throws java.rmi.RemoteException
ChServer
getDevice
in interface ChServer
java.rmi.RemoteException
public static void error(java.lang.String msg)
public static void problem(java.lang.String msg)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |