Last change
on this file since 99 was
92,
checked in by stoda, 11 years ago
|
TODO: delete in supervisor
check the code
|
File size:
1.2 KB
|
Line | |
---|
1 | package omq.common.broker; |
---|
2 | |
---|
3 | import java.io.IOException; |
---|
4 | import java.util.Properties; |
---|
5 | import java.util.Set; |
---|
6 | |
---|
7 | import omq.exception.RemoteException; |
---|
8 | import omq.server.RemoteObject; |
---|
9 | |
---|
10 | /** |
---|
11 | * |
---|
12 | * @author Sergi Toda <sergi.toda@estudiants.urv.cat> |
---|
13 | * |
---|
14 | */ |
---|
15 | public class RemoteBrokerImpl extends RemoteObject implements RemoteBroker { |
---|
16 | |
---|
17 | /** |
---|
18 | * |
---|
19 | */ |
---|
20 | private static final long serialVersionUID = 1L; |
---|
21 | |
---|
22 | @Override |
---|
23 | public Set<String> getRemoteObjects() { |
---|
24 | return getBroker().getRemoteObjs().keySet(); |
---|
25 | } |
---|
26 | |
---|
27 | @Override |
---|
28 | public void spawnObject(String reference, String className, Properties env) throws Exception { |
---|
29 | RemoteObject remote = (RemoteObject) Class.forName(className).newInstance(); |
---|
30 | getBroker().bind(reference, remote, env); |
---|
31 | } |
---|
32 | |
---|
33 | @Override |
---|
34 | public void spawnObject(String reference, String className) throws Exception { |
---|
35 | RemoteObject remote = (RemoteObject) Class.forName(className).newInstance(); |
---|
36 | getBroker().bind(reference, remote); |
---|
37 | } |
---|
38 | |
---|
39 | @Override |
---|
40 | public void deleteObject(String reference) throws RemoteException, IOException { |
---|
41 | getBroker().unbind(reference); |
---|
42 | } |
---|
43 | |
---|
44 | @Override |
---|
45 | public boolean hasObject(String reference) { |
---|
46 | return getBroker().getRemoteObjs().containsKey(reference); |
---|
47 | } |
---|
48 | |
---|
49 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.