org.alfresco.repo.jgroups
Class AlfrescoJGroupsChannelFactory.ChannelProxy
java.lang.Object
org.jgroups.Channel
org.alfresco.repo.jgroups.AlfrescoJGroupsChannelFactory.ChannelProxy
- All Implemented Interfaces:
- org.jgroups.Transport
- Enclosing class:
- AlfrescoJGroupsChannelFactory
public static class AlfrescoJGroupsChannelFactory.ChannelProxy
- extends org.jgroups.Channel
A proxy channel that can be used to hot-swap underlying channels. All listeners
and the receiver will be carried over to the new underlying channel when it is
swapped out.
Fields inherited from class org.jgroups.Channel |
AUTO_GETSTATE, AUTO_RECONNECT, BLOCK, channel_listeners, GET_STATE_EVENTS, LOCAL, receiver, socket_factory, SUSPECT, up_handler, VIEW |
Method Summary |
void |
addChannelListener(org.jgroups.ChannelListener listener)
|
void |
blockOk()
|
void |
clearChannelListeners()
|
void |
close()
|
void |
connect(java.lang.String cluster_name)
|
void |
connect(java.lang.String cluster_name,
org.jgroups.Address target,
java.lang.String state_id,
long timeout)
|
void |
disconnect()
|
void |
down(org.jgroups.Event evt)
|
java.lang.Object |
downcall(org.jgroups.Event evt)
|
java.lang.String |
dumpQueue()
|
java.util.Map |
dumpStats()
|
boolean |
equals(java.lang.Object obj)
|
boolean |
flushSupported()
|
org.jgroups.Address |
getAddress()
|
boolean |
getAllStates(java.util.Vector targets,
long timeout)
|
java.lang.String |
getChannelName()
|
java.lang.String |
getClusterName()
|
org.jgroups.Channel |
getDelegate()
|
java.util.Map |
getInfo()
|
org.jgroups.Address |
getLocalAddress()
|
protected org.jgroups.logging.Log |
getLog()
|
java.lang.String |
getName()
|
java.lang.String |
getName(org.jgroups.Address member)
|
int |
getNumMessages()
|
java.lang.Object |
getOpt(int option)
|
org.jgroups.stack.ProtocolStack |
getProtocolStack()
|
boolean |
getState(org.jgroups.Address target,
long timeout)
|
boolean |
getState(org.jgroups.Address target,
java.lang.String state_id,
long timeout)
|
org.jgroups.View |
getView()
|
int |
hashCode()
|
boolean |
isConnected()
|
boolean |
isOpen()
|
void |
open()
|
java.lang.Object |
peek(long timeout)
|
java.lang.Object |
receive(long timeout)
|
void |
removeChannelListener(org.jgroups.ChannelListener listener)
|
void |
returnState(byte[] state)
|
void |
returnState(byte[] state,
java.lang.String state_id)
|
void |
send(org.jgroups.Address dst,
org.jgroups.Address src,
byte[] buf)
|
void |
send(org.jgroups.Address dst,
org.jgroups.Address src,
byte[] buf,
int offset,
int length)
|
void |
send(org.jgroups.Address dst,
org.jgroups.Address src,
java.io.Serializable obj)
|
void |
send(org.jgroups.Message msg)
|
void |
setChannelListener(org.jgroups.ChannelListener channel_listener)
|
void |
setInfo(java.lang.String key,
java.lang.Object value)
|
void |
setName(java.lang.String name)
|
void |
setOpt(int option,
java.lang.Object value)
|
void |
setReceiver(org.jgroups.Receiver r)
|
void |
setUpHandler(org.jgroups.UpHandler up_handler)
|
void |
shutdown()
|
boolean |
startFlush(boolean automatic_resume)
|
boolean |
startFlush(java.util.List flushParticipants,
boolean automatic_resume)
|
boolean |
startFlush(long timeout,
boolean automatic_resume)
|
void |
stopFlush()
|
void |
stopFlush(java.util.List flushParticipants)
|
org.jgroups.Channel |
swap(org.jgroups.Channel channel)
Swap the channel. |
java.lang.String |
toString()
|
Methods inherited from class org.jgroups.Channel |
getProperties, getReceiver, getSocketFactory, getUpHandler, notifyChannelClosed, notifyChannelConnected, notifyChannelDisconnected, option2String, setSocketFactory |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
AlfrescoJGroupsChannelFactory.ChannelProxy
public AlfrescoJGroupsChannelFactory.ChannelProxy(org.jgroups.Channel delegate)
- Parameters:
delegate
- the real channel that will do the work
getDelegate
public org.jgroups.Channel getDelegate()
- Returns:
- Returns the channel to which the implementation will delegate
swap
public org.jgroups.Channel swap(org.jgroups.Channel channel)
- Swap the channel. The old delegate will be disconnected before the swap occurs.
This guarantees data consistency, assuming that any failures will be handled.
Note that the old delegate is not closed or shutdown.
- Parameters:
the
- new delegate
- Returns:
- the old, disconnected delegate
getLog
protected org.jgroups.logging.Log getLog()
- Specified by:
getLog
in class org.jgroups.Channel
getAddress
public org.jgroups.Address getAddress()
- Specified by:
getAddress
in class org.jgroups.Channel
getName
public java.lang.String getName()
- Specified by:
getName
in class org.jgroups.Channel
getProtocolStack
public org.jgroups.stack.ProtocolStack getProtocolStack()
- Specified by:
getProtocolStack
in class org.jgroups.Channel
setReceiver
public void setReceiver(org.jgroups.Receiver r)
- Overrides:
setReceiver
in class org.jgroups.Channel
addChannelListener
public void addChannelListener(org.jgroups.ChannelListener listener)
- Overrides:
addChannelListener
in class org.jgroups.Channel
removeChannelListener
public void removeChannelListener(org.jgroups.ChannelListener listener)
- Overrides:
removeChannelListener
in class org.jgroups.Channel
clearChannelListeners
public void clearChannelListeners()
- Overrides:
clearChannelListeners
in class org.jgroups.Channel
setUpHandler
public void setUpHandler(org.jgroups.UpHandler up_handler)
- Overrides:
setUpHandler
in class org.jgroups.Channel
blockOk
public void blockOk()
- Specified by:
blockOk
in class org.jgroups.Channel
close
public void close()
- Specified by:
close
in class org.jgroups.Channel
connect
public void connect(java.lang.String cluster_name,
org.jgroups.Address target,
java.lang.String state_id,
long timeout)
throws org.jgroups.ChannelException
- Specified by:
connect
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelException
connect
public void connect(java.lang.String cluster_name)
throws org.jgroups.ChannelException
- Specified by:
connect
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelException
disconnect
public void disconnect()
- Specified by:
disconnect
in class org.jgroups.Channel
down
public void down(org.jgroups.Event evt)
- Overrides:
down
in class org.jgroups.Channel
downcall
public java.lang.Object downcall(org.jgroups.Event evt)
- Overrides:
downcall
in class org.jgroups.Channel
dumpQueue
public java.lang.String dumpQueue()
- Overrides:
dumpQueue
in class org.jgroups.Channel
dumpStats
public java.util.Map dumpStats()
- Specified by:
dumpStats
in class org.jgroups.Channel
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
flushSupported
public boolean flushSupported()
- Specified by:
flushSupported
in class org.jgroups.Channel
getAllStates
public boolean getAllStates(java.util.Vector targets,
long timeout)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException
- Specified by:
getAllStates
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
getChannelName
public java.lang.String getChannelName()
- Specified by:
getChannelName
in class org.jgroups.Channel
getClusterName
public java.lang.String getClusterName()
- Specified by:
getClusterName
in class org.jgroups.Channel
getInfo
public java.util.Map getInfo()
- Specified by:
getInfo
in class org.jgroups.Channel
getLocalAddress
public org.jgroups.Address getLocalAddress()
- Specified by:
getLocalAddress
in class org.jgroups.Channel
getNumMessages
public int getNumMessages()
- Overrides:
getNumMessages
in class org.jgroups.Channel
getOpt
public java.lang.Object getOpt(int option)
- Specified by:
getOpt
in class org.jgroups.Channel
getState
public boolean getState(org.jgroups.Address target,
long timeout)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException
- Specified by:
getState
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
getState
public boolean getState(org.jgroups.Address target,
java.lang.String state_id,
long timeout)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException
- Specified by:
getState
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
getView
public org.jgroups.View getView()
- Specified by:
getView
in class org.jgroups.Channel
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
isConnected
public boolean isConnected()
- Specified by:
isConnected
in class org.jgroups.Channel
isOpen
public boolean isOpen()
- Specified by:
isOpen
in class org.jgroups.Channel
open
public void open()
throws org.jgroups.ChannelException
- Overrides:
open
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelException
peek
public java.lang.Object peek(long timeout)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException,
org.jgroups.TimeoutException
- Specified by:
peek
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
org.jgroups.TimeoutException
receive
public java.lang.Object receive(long timeout)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException,
org.jgroups.TimeoutException
- Specified by:
receive
in interface org.jgroups.Transport
- Specified by:
receive
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
org.jgroups.TimeoutException
returnState
public void returnState(byte[] state,
java.lang.String state_id)
- Specified by:
returnState
in class org.jgroups.Channel
returnState
public void returnState(byte[] state)
- Specified by:
returnState
in class org.jgroups.Channel
send
public void send(org.jgroups.Address dst,
org.jgroups.Address src,
java.io.Serializable obj)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException
- Specified by:
send
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
send
public void send(org.jgroups.Message msg)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException
- Specified by:
send
in interface org.jgroups.Transport
- Specified by:
send
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
setChannelListener
public void setChannelListener(org.jgroups.ChannelListener channel_listener)
- Overrides:
setChannelListener
in class org.jgroups.Channel
setInfo
public void setInfo(java.lang.String key,
java.lang.Object value)
- Specified by:
setInfo
in class org.jgroups.Channel
setOpt
public void setOpt(int option,
java.lang.Object value)
- Specified by:
setOpt
in class org.jgroups.Channel
shutdown
public void shutdown()
- Specified by:
shutdown
in class org.jgroups.Channel
startFlush
public boolean startFlush(boolean automatic_resume)
- Specified by:
startFlush
in class org.jgroups.Channel
startFlush
public boolean startFlush(java.util.List flushParticipants,
boolean automatic_resume)
- Specified by:
startFlush
in class org.jgroups.Channel
startFlush
public boolean startFlush(long timeout,
boolean automatic_resume)
- Specified by:
startFlush
in class org.jgroups.Channel
stopFlush
public void stopFlush()
- Specified by:
stopFlush
in class org.jgroups.Channel
stopFlush
public void stopFlush(java.util.List flushParticipants)
- Specified by:
stopFlush
in class org.jgroups.Channel
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getName
public java.lang.String getName(org.jgroups.Address member)
- Specified by:
getName
in class org.jgroups.Channel
send
public void send(org.jgroups.Address dst,
org.jgroups.Address src,
byte[] buf)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException
- Specified by:
send
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
send
public void send(org.jgroups.Address dst,
org.jgroups.Address src,
byte[] buf,
int offset,
int length)
throws org.jgroups.ChannelNotConnectedException,
org.jgroups.ChannelClosedException
- Specified by:
send
in class org.jgroups.Channel
- Throws:
org.jgroups.ChannelNotConnectedException
org.jgroups.ChannelClosedException
setName
public void setName(java.lang.String name)
- Specified by:
setName
in class org.jgroups.Channel
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.