|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.kwfgrid.gwes.uiproxy.UIProxyImpl
public class UIProxyImpl
The UIProxy. Facade for buffers, subscription handler and leasing system. The current implementation has no sophisticating synchronization management. This may lead to performance issues with multiple clients and buffers and should be fixed in the future.
| Nested Class Summary | |
|---|---|
protected class |
UIProxyImpl.Lease
|
| Field Summary | |
|---|---|
protected BufferFactory |
_bfact
|
protected HashMapOfMaps |
_clients
clientid -> bufferids -> buffer. |
protected MessageCodec |
_codec
|
protected HashMap |
_leases
clientid -> lease |
protected int |
_leasetime
|
protected SubscriptionHandler |
_shandler
|
protected HashMapOfMaps |
_subscriptions
clientid -> bufferids -> subscription |
static int |
DEFAULT_LEASE_TIME
|
| Constructor Summary | |
|---|---|
UIProxyImpl(BufferFactory bfact,
MessageCodec codec,
SubscriptionHandler shandler)
|
|
| Method Summary | |
|---|---|
void |
disposeBuffer(String clientid,
String bufferid)
Dispose a buffer. |
void |
disposeClient(String clientid)
Dispose a whole client. |
protected Buffer |
getBuffer(String clientid,
String bufferid)
|
int |
getLeaseTime()
|
String[] |
poll(String clientid,
String bufferid)
Poll all buffered notifications for the specified client and buffer. |
void |
renewLease(String clientid)
Renew the lease for the specified client. |
void |
setBufferProperty(String clientid,
String bufferid,
String key,
String value)
Set a property of a buffer. |
void |
setLeaseTime(int time)
|
String |
subscribe(String clientid,
String subscription,
String buffertype,
String[] propkeys,
String[] propvalues)
Subscribe for messages at a publisher. |
protected void |
timeout(String clientid)
Called if a lease has timed out. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_LEASE_TIME
protected HashMapOfMaps _clients
protected HashMapOfMaps _subscriptions
protected HashMap _leases
protected BufferFactory _bfact
protected SubscriptionHandler _shandler
protected MessageCodec _codec
protected int _leasetime
| Constructor Detail |
|---|
public UIProxyImpl(BufferFactory bfact,
MessageCodec codec,
SubscriptionHandler shandler)
| Method Detail |
|---|
public void setLeaseTime(int time)
public int getLeaseTime()
protected Buffer getBuffer(String clientid,
String bufferid)
public String subscribe(String clientid,
String subscription,
String buffertype,
String[] propkeys,
String[] propvalues)
throws SubscriptionFailed
subscribe in interface UIProxyclientid - The UUID of the client.subscription - Specification of the subscription.buffertype - The type of the buffer to be created.propkeys - The keys of the properties of the buffer, same index as propvalues.propvalues - The values of the properties of the buffer, same index as propkeys.
SubscriptionFailed - If the subscription failed.public void renewLease(String clientid)
renewLease in interface UIProxyclientid - The UUID of the client.
public void setBufferProperty(String clientid,
String bufferid,
String key,
String value)
throws BufferException
setBufferProperty in interface UIProxyclientid - The UUID of the client.bufferid - The UUID of the buffer.key - The name of the property.value - The value of the property
BufferException - If an exception occured when setting the property.
public void disposeBuffer(String clientid,
String bufferid)
disposeBuffer in interface UIProxyclientid - The UUID of the client.bufferid - The UUID of the buffer.public void disposeClient(String clientid)
disposeClient in interface UIProxyclientid - The UUID of the client.protected void timeout(String clientid)
public String[] poll(String clientid,
String bufferid)
throws CodecException,
BufferException,
UnknownClientException,
UnknownBufferException
poll in interface UIProxyBufferException - If a exception occured at the buffer when handling a message. In that case the client will have to create a new
Buffer.
UnknownClientException - If the specified client is unknown to the UIProxy. This may also happen if the lease has timed out for the
specified client.
UnknownBufferException - If the specified buffer is unknown to the UIProxy. This may also happen if the buffer previously encountered
a BufferException.
specified client.
CodecException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||