]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/rmi/AutoUiServerImpl.java
1 package org
.argeo
.slc
.autoui
.rmi
;
3 import java
.rmi
.Naming
;
4 import java
.rmi
.RemoteException
;
5 import java
.rmi
.registry
.LocateRegistry
;
6 import java
.rmi
.registry
.Registry
;
7 import java
.rmi
.server
.UnicastRemoteObject
;
9 import java
.util
.TreeMap
;
11 public class AutoUiServerImpl
extends UnicastRemoteObject
implements
12 AutoUiServer
, AutoUiContext
{
13 private Map map
= new TreeMap();
15 public AutoUiServerImpl() throws RemoteException
{
19 public Object
executeTask(AutoUiTask task
) throws RemoteException
{
21 return task
.execute(this);
22 } catch (Exception e
) {
23 throw new RemoteException("Coul not execute task.", e
);
27 public Object
getLocalRef(String key
) {
31 public void setLocalRef(String key
, Object ref
) {
35 public static void main(String
[] args
) {
36 if (System
.getSecurityManager() == null) {
37 System
.setSecurityManager(new SecurityManager());
40 String name
= "AutoUiServer";
41 AutoUiServer engine
= new AutoUiServerImpl();
42 // AutoUiServer stub = (AutoUiServer) UnicastRemoteObject
43 // .exportObject(engine, 0);
44 // Registry registry = LocateRegistry.getRegistry();
45 // registry.rebind(name, stub);
46 Naming
.rebind(name
, engine
);
47 System
.out
.println("AutoUiServer bound");
49 } catch (Exception e
) {
50 System
.err
.println("AutoUiServer exception:");