public class LocalChannelProxy extends Object implements IChannelProxy
ChannelInlet and a number
of ChannelOutlet that reside within the same virtual machine's address spaceIChannelProxy.ProxyConnector| Modifier | Constructor and Description |
|---|---|
protected |
LocalChannelProxy()
Instantiates a new local channel proxy to be used on the
ChannelInlet side |
|
LocalChannelProxy(IChannelLocator Locator,
String NozzleID)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Boolean |
CanHandleProxyLocator(IChannelLocator.LocatorType Locator)
Checks if this proxy can handle the specific type of locator
|
void |
Dispose()
Disposes the proxy
|
ChannelState |
GetChannelState()
Retrieves the
ChannelState that the proxy mediates for and is used to synchronize
between the various instances of the ChannelState all connected nozzles use |
IChannelLocator |
GetLocator()
Retrieves a locator to this proxy
|
IChannelProxy.ProxyConnector |
GetProxyType()
Retrieves the type of proxy
|
Boolean |
HasConnected()
Depending on the side the
IChannelProxy mediates for, this method has a slightly different
meaning. |
void |
SetChannelRegistryKey(ChannelRegistryKey RegistryKey)
Sets the
ChannelRegistryKey this proxy will manage. |
Boolean |
StillConnected()
Depending on the side the
IChannelProxy mediates for, this method has a slightly different
meaning. |
protected LocalChannelProxy()
ChannelInlet sidepublic LocalChannelProxy(IChannelLocator Locator, String NozzleID)
ChannelOutlet side. A call to IChannelProxy.CanHandleProxyLocator(gr.uoa.di.madgik.commons.channel.proxy.IChannelLocator.LocatorType)
is made to check if the locator provided can be used with this proxy instantiation. The locator that can be used with this
proxy must be of type LocalChannelLocator. If either of the the two above conditions do not hold, an exception
is thrown. The local registry is then looked through the ChannelRegistry.Retrieve(ChannelRegistryKey)
using as key the id retrieved by IChannelLocator.GetRegistryKey(). If the channel is not registered
an exception is thrown. Otherwise, a reference to the ChannelState is retrieved and stored within the proxy.
Before continuing the ChannelRegistryEntry.RegisterNozzle(RegisteredNozzle) method is called to
register the outlet nozzleLocator - The locator this proxy should use as returned by the inlet's proxy IChannelProxy.GetLocator()NozzleID - the id of the outlet nozzlepublic ChannelState GetChannelState()
IChannelProxyChannelState that the proxy mediates for and is used to synchronize
between the various instances of the ChannelState all connected nozzles useGetChannelState in interface IChannelProxypublic Boolean CanHandleProxyLocator(IChannelLocator.LocatorType Locator)
IChannelProxyCanHandleProxyLocator in interface IChannelProxyLocator - The type of Locatorpublic void Dispose()
IChannelProxyDispose in interface IChannelProxypublic IChannelLocator GetLocator()
IChannelProxyGetLocator in interface IChannelProxypublic IChannelProxy.ProxyConnector GetProxyType()
IChannelProxyGetProxyType in interface IChannelProxypublic void SetChannelRegistryKey(ChannelRegistryKey RegistryKey)
IChannelProxyChannelRegistryKey this proxy will manage. This method is called by the
ChannelRegistry.Register(ChannelState, INozzleConfig, String)
when called by the ChannelInlet initialization constructor. This proxy instance is
passed to the nozzle's constructor through the INozzleConfig and is updated by calling
the IChannelProxy.SetChannelRegistryKey(ChannelRegistryKey) from the registry's method.SetChannelRegistryKey in interface IChannelProxyRegistryKey - the registry keypublic Boolean HasConnected()
IChannelProxyIChannelProxy mediates for, this method has a slightly different
meaning. On the inlet side, it checks if any outlets has been connected to the exposed channel.
On the outlet side, it checks if the outlet has been connected to the inlet.HasConnected in interface IChannelProxypublic Boolean StillConnected()
IChannelProxyIChannelProxy mediates for, this method has a slightly different
meaning. On the inlet side, it checks if any outlets is still connected to the exposed channel.
On the outlet side, it checks if the outlet is still connected to the inlet. This method should
only be used after the IChannelProxy.HasConnected() has already been set to trueStillConnected in interface IChannelProxyCopyright © 2018. All Rights Reserved.