public class LocalWriterProxy extends Object implements IWriterProxy
IWriterProxy interface available to be
used by writers that want to make available their authored IBuffer only to
readers that are collocated in the same JVM as they areIProxy.ProxyTypeProxyScheme, ProxyStoreScheme| Constructor and Description |
|---|
LocalWriterProxy()
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
IMirror |
bind()
After setting the registry key, this method is used to retrieve the
IMirror that can
serve the mirroring procedure for a reader |
URI |
getLocator()
|
static boolean |
isOfType(URI locator)
Checks if the provided URI is of a type that can be managed by an instance of this class.
|
void |
setKey(String key)
Sets the key that was assigned to the serving
IBuffer through the buffer registry |
public void setKey(String key) throws GRS2ProxyInvalidOperationException
IBuffer through the buffer registrysetKey in interface IWriterProxykey - the registry keyGRS2ProxyInvalidOperationException - if the key is already set for this instanceIWriterProxy.setKey(java.lang.String)public IMirror bind()
IMirror that can
serve the mirroring procedure for a reader
Always returns null. This type of locator does not employ any IMirror instance to
handle the synchronization between reader and writer as this is managed directly though
the underlying IBuffer
bind in interface IWriterProxyIMirrorIWriterProxy.bind()public URI getLocator() throws GRS2ProxyInvalidOperationException, GRS2ProxyInvalidArgumentException
IMirror
serving the registered IBuffer
The created uri uses the scheme of IProxy.ProxyScheme, "localhost" as the
host name and sets the fragment to IProxy.ProxyType.Local.
An example of the created locator is
grs2-proxy://localhost?key=13bc140f-3013-4ce1-83b4-4d57d46863b0#Local
getLocator in interface IWriterProxyGRS2ProxyInvalidOperationException - if the set key is null or emptyGRS2ProxyInvalidArgumentException - if there was a problem creating the locator URIIWriterProxy.getLocator()public static boolean isOfType(URI locator)
grs2-proxy://localhost?key=13bc140f-3013-4ce1-83b4-4d57d46863b0#Locallocator - the locator URi that needs to be checkedCopyright © 2014. All Rights Reserved.