com.taobao.metamorphosis.client
类 RemotingClientWrapper

java.lang.Object
  继承者 com.taobao.metamorphosis.client.RemotingClientWrapper
所有已实现的接口:
com.taobao.gecko.service.RemotingClient, com.taobao.gecko.service.RemotingController

public class RemotingClientWrapper
extends Object
implements com.taobao.gecko.service.RemotingClient

RemotingClient包装,添加连接的建立和关闭的计数

作者:
boyan

构造方法摘要
RemotingClientWrapper(com.taobao.gecko.service.RemotingClient remotingClient)
           
 
方法摘要
 void addAllProcessors(Map<Class<? extends com.taobao.gecko.core.command.RequestCommand>,com.taobao.gecko.service.RequestProcessor<? extends com.taobao.gecko.core.command.RequestCommand>> map)
           
 void addConnectionLifeCycleListener(com.taobao.gecko.service.ConnectionLifeCycleListener connectionLifeCycleListener)
           
 void awaitReadyInterrupt(String url)
           
 void awaitReadyInterrupt(String url, long time)
           
 void close(String url, boolean allowReconnect)
           
 void closeWithRef(String url, Object ref, boolean allowReconnect)
           
 void connect(String url)
           
 void connect(String url, int connCount)
           
 void connect(String url, String targetGroup)
           
 void connect(String url, String targetGroup, int connCount)
           
 void connectWithRef(String url, int connCount, Object ref)
           
 void connectWithRef(String url, Object ref)
           
 Object getAttribute(String group, String key)
           
 int getConnectionCount(String group)
           
 Set<String> getGroupSet()
           
 com.taobao.gecko.service.RequestProcessor<? extends com.taobao.gecko.core.command.RequestCommand> getProcessor(Class<? extends com.taobao.gecko.core.command.RequestCommand> clazz)
           
 InetSocketAddress getRemoteAddress(String url)
           
 String getRemoteAddressString(String url)
           
 com.taobao.gecko.service.RemotingContext getRemotingContext()
           
 void insertTimer(com.taobao.gecko.core.nio.impl.TimerRef timerRef)
           
 com.taobao.gecko.core.command.ResponseCommand invokeToGroup(String group, com.taobao.gecko.core.command.RequestCommand command)
           
 com.taobao.gecko.core.command.ResponseCommand invokeToGroup(String group, com.taobao.gecko.core.command.RequestCommand command, long time, TimeUnit timeUnit)
           
 Map<com.taobao.gecko.service.Connection,com.taobao.gecko.core.command.ResponseCommand> invokeToGroupAllConnections(String group, com.taobao.gecko.core.command.RequestCommand command)
           
 Map<com.taobao.gecko.service.Connection,com.taobao.gecko.core.command.ResponseCommand> invokeToGroupAllConnections(String group, com.taobao.gecko.core.command.RequestCommand command, long time, TimeUnit timeUnit)
           
 boolean isConnected(String url)
           
 boolean isStarted()
           
<T extends com.taobao.gecko.core.command.RequestCommand>
void
registerProcessor(Class<T> commandClazz, com.taobao.gecko.service.RequestProcessor<T> processor)
           
 Object removeAttribute(String group, String key)
           
 void removeConnectionLifeCycleListener(com.taobao.gecko.service.ConnectionLifeCycleListener connectionLifeCycleListener)
           
 com.taobao.gecko.service.Connection selectConnectionForGroup(String group, com.taobao.gecko.service.ConnectionSelector connectionSelector, com.taobao.gecko.core.command.RequestCommand request)
           
 void sendToAllConnections(com.taobao.gecko.core.command.RequestCommand command)
           
 void sendToGroup(String group, com.taobao.gecko.core.command.RequestCommand command)
           
 void sendToGroup(String group, com.taobao.gecko.core.command.RequestCommand command, com.taobao.gecko.service.SingleRequestCallBackListener listener)
           
 void sendToGroup(String group, com.taobao.gecko.core.command.RequestCommand command, com.taobao.gecko.service.SingleRequestCallBackListener listener, long time, TimeUnit timeunut)
           
 void sendToGroupAllConnections(String group, com.taobao.gecko.core.command.RequestCommand command)
           
 void sendToGroupAllConnections(String group, com.taobao.gecko.core.command.RequestCommand command, com.taobao.gecko.service.GroupAllConnectionCallBackListener listener)
           
 void sendToGroupAllConnections(String group, com.taobao.gecko.core.command.RequestCommand command, com.taobao.gecko.service.GroupAllConnectionCallBackListener listener, long time, TimeUnit timeUnit)
           
 void sendToGroups(Map<String,com.taobao.gecko.core.command.RequestCommand> groupObjects)
           
 void sendToGroups(Map<String,com.taobao.gecko.core.command.RequestCommand> groupObjects, com.taobao.gecko.service.MultiGroupCallBackListener listener, long timeout, TimeUnit timeUnit, Object... args)
           
 void setAttribute(String group, String key, Object value)
           
 Object setAttributeIfAbsent(String group, String key, Object value)
           
 void setClientConfig(com.taobao.gecko.service.config.ClientConfig clientConfig)
           
 void setConnectionSelector(com.taobao.gecko.service.ConnectionSelector selector)
           
 void start()
           
 void stop()
           
 void transferToGroup(String group, com.taobao.gecko.core.buffer.IoBuffer head, com.taobao.gecko.core.buffer.IoBuffer tail, FileChannel channel, long position, long size)
           
 void transferToGroup(String group, com.taobao.gecko.core.buffer.IoBuffer head, com.taobao.gecko.core.buffer.IoBuffer tail, FileChannel channel, long position, long size, Integer opaque, com.taobao.gecko.service.SingleRequestCallBackListener listener, long time, TimeUnit unit)
           
 com.taobao.gecko.service.RequestProcessor<? extends com.taobao.gecko.core.command.RequestCommand> unreigsterProcessor(Class<? extends com.taobao.gecko.core.command.RequestCommand> clazz)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

RemotingClientWrapper

public RemotingClientWrapper(com.taobao.gecko.service.RemotingClient remotingClient)
方法详细信息

connect

public void connect(String url,
                    String targetGroup,
                    int connCount)
             throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 connect
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

connect

public void connect(String url,
                    String targetGroup)
             throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 connect
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

addAllProcessors

public void addAllProcessors(Map<Class<? extends com.taobao.gecko.core.command.RequestCommand>,com.taobao.gecko.service.RequestProcessor<? extends com.taobao.gecko.core.command.RequestCommand>> map)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 addAllProcessors

addConnectionLifeCycleListener

public void addConnectionLifeCycleListener(com.taobao.gecko.service.ConnectionLifeCycleListener connectionLifeCycleListener)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 addConnectionLifeCycleListener

awaitReadyInterrupt

public void awaitReadyInterrupt(String url,
                                long time)
                         throws com.taobao.gecko.service.exception.NotifyRemotingException,
                                InterruptedException
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 awaitReadyInterrupt
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException
InterruptedException

awaitReadyInterrupt

public void awaitReadyInterrupt(String url)
                         throws com.taobao.gecko.service.exception.NotifyRemotingException,
                                InterruptedException
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 awaitReadyInterrupt
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException
InterruptedException

connect

public void connect(String url)
             throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 connect
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

connect

public void connect(String url,
                    int connCount)
             throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 connect
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

close

public void close(String url,
                  boolean allowReconnect)
           throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 close
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

closeWithRef

public void closeWithRef(String url,
                         Object ref,
                         boolean allowReconnect)
                  throws com.taobao.gecko.service.exception.NotifyRemotingException
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

connectWithRef

public void connectWithRef(String url,
                           int connCount,
                           Object ref)
                    throws com.taobao.gecko.service.exception.NotifyRemotingException
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

connectWithRef

public void connectWithRef(String url,
                           Object ref)
                    throws com.taobao.gecko.service.exception.NotifyRemotingException
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

getAttribute

public Object getAttribute(String group,
                           String key)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 getAttribute

getConnectionCount

public int getConnectionCount(String group)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 getConnectionCount

getGroupSet

public Set<String> getGroupSet()
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 getGroupSet

getProcessor

public com.taobao.gecko.service.RequestProcessor<? extends com.taobao.gecko.core.command.RequestCommand> getProcessor(Class<? extends com.taobao.gecko.core.command.RequestCommand> clazz)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 getProcessor

getRemoteAddress

public InetSocketAddress getRemoteAddress(String url)
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 getRemoteAddress

getRemoteAddressString

public String getRemoteAddressString(String url)
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 getRemoteAddressString

getRemotingContext

public com.taobao.gecko.service.RemotingContext getRemotingContext()
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 getRemotingContext

insertTimer

public void insertTimer(com.taobao.gecko.core.nio.impl.TimerRef timerRef)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 insertTimer

invokeToGroup

public com.taobao.gecko.core.command.ResponseCommand invokeToGroup(String group,
                                                                   com.taobao.gecko.core.command.RequestCommand command,
                                                                   long time,
                                                                   TimeUnit timeUnit)
                                                            throws InterruptedException,
                                                                   TimeoutException,
                                                                   com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 invokeToGroup
抛出:
InterruptedException
TimeoutException
com.taobao.gecko.service.exception.NotifyRemotingException

invokeToGroup

public com.taobao.gecko.core.command.ResponseCommand invokeToGroup(String group,
                                                                   com.taobao.gecko.core.command.RequestCommand command)
                                                            throws InterruptedException,
                                                                   TimeoutException,
                                                                   com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 invokeToGroup
抛出:
InterruptedException
TimeoutException
com.taobao.gecko.service.exception.NotifyRemotingException

invokeToGroupAllConnections

public Map<com.taobao.gecko.service.Connection,com.taobao.gecko.core.command.ResponseCommand> invokeToGroupAllConnections(String group,
                                                                                                                          com.taobao.gecko.core.command.RequestCommand command,
                                                                                                                          long time,
                                                                                                                          TimeUnit timeUnit)
                                                                                                                   throws InterruptedException,
                                                                                                                          com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 invokeToGroupAllConnections
抛出:
InterruptedException
com.taobao.gecko.service.exception.NotifyRemotingException

invokeToGroupAllConnections

public Map<com.taobao.gecko.service.Connection,com.taobao.gecko.core.command.ResponseCommand> invokeToGroupAllConnections(String group,
                                                                                                                          com.taobao.gecko.core.command.RequestCommand command)
                                                                                                                   throws InterruptedException,
                                                                                                                          com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 invokeToGroupAllConnections
抛出:
InterruptedException
com.taobao.gecko.service.exception.NotifyRemotingException

isConnected

public boolean isConnected(String url)
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 isConnected

isStarted

public boolean isStarted()
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 isStarted

registerProcessor

public <T extends com.taobao.gecko.core.command.RequestCommand> void registerProcessor(Class<T> commandClazz,
                                                                                       com.taobao.gecko.service.RequestProcessor<T> processor)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 registerProcessor

removeAttribute

public Object removeAttribute(String group,
                              String key)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 removeAttribute

removeConnectionLifeCycleListener

public void removeConnectionLifeCycleListener(com.taobao.gecko.service.ConnectionLifeCycleListener connectionLifeCycleListener)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 removeConnectionLifeCycleListener

selectConnectionForGroup

public com.taobao.gecko.service.Connection selectConnectionForGroup(String group,
                                                                    com.taobao.gecko.service.ConnectionSelector connectionSelector,
                                                                    com.taobao.gecko.core.command.RequestCommand request)
                                                             throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 selectConnectionForGroup
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToAllConnections

public void sendToAllConnections(com.taobao.gecko.core.command.RequestCommand command)
                          throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToAllConnections
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroup

public void sendToGroup(String group,
                        com.taobao.gecko.core.command.RequestCommand command,
                        com.taobao.gecko.service.SingleRequestCallBackListener listener,
                        long time,
                        TimeUnit timeunut)
                 throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroup
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroup

public void sendToGroup(String group,
                        com.taobao.gecko.core.command.RequestCommand command,
                        com.taobao.gecko.service.SingleRequestCallBackListener listener)
                 throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroup
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroup

public void sendToGroup(String group,
                        com.taobao.gecko.core.command.RequestCommand command)
                 throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroup
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroupAllConnections

public void sendToGroupAllConnections(String group,
                                      com.taobao.gecko.core.command.RequestCommand command,
                                      com.taobao.gecko.service.GroupAllConnectionCallBackListener listener,
                                      long time,
                                      TimeUnit timeUnit)
                               throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroupAllConnections
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroupAllConnections

public void sendToGroupAllConnections(String group,
                                      com.taobao.gecko.core.command.RequestCommand command,
                                      com.taobao.gecko.service.GroupAllConnectionCallBackListener listener)
                               throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroupAllConnections
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroupAllConnections

public void sendToGroupAllConnections(String group,
                                      com.taobao.gecko.core.command.RequestCommand command)
                               throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroupAllConnections
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroups

public void sendToGroups(Map<String,com.taobao.gecko.core.command.RequestCommand> groupObjects,
                         com.taobao.gecko.service.MultiGroupCallBackListener listener,
                         long timeout,
                         TimeUnit timeUnit,
                         Object... args)
                  throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroups
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

sendToGroups

public void sendToGroups(Map<String,com.taobao.gecko.core.command.RequestCommand> groupObjects)
                  throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 sendToGroups
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

setAttribute

public void setAttribute(String group,
                         String key,
                         Object value)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 setAttribute

setAttributeIfAbsent

public Object setAttributeIfAbsent(String group,
                                   String key,
                                   Object value)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 setAttributeIfAbsent

setClientConfig

public void setClientConfig(com.taobao.gecko.service.config.ClientConfig clientConfig)
指定者:
接口 com.taobao.gecko.service.RemotingClient 中的 setClientConfig

setConnectionSelector

public void setConnectionSelector(com.taobao.gecko.service.ConnectionSelector selector)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 setConnectionSelector

start

public void start()
           throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 start
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

stop

public void stop()
          throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 stop
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

unreigsterProcessor

public com.taobao.gecko.service.RequestProcessor<? extends com.taobao.gecko.core.command.RequestCommand> unreigsterProcessor(Class<? extends com.taobao.gecko.core.command.RequestCommand> clazz)
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 unreigsterProcessor

transferToGroup

public void transferToGroup(String group,
                            com.taobao.gecko.core.buffer.IoBuffer head,
                            com.taobao.gecko.core.buffer.IoBuffer tail,
                            FileChannel channel,
                            long position,
                            long size,
                            Integer opaque,
                            com.taobao.gecko.service.SingleRequestCallBackListener listener,
                            long time,
                            TimeUnit unit)
                     throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 transferToGroup
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException

transferToGroup

public void transferToGroup(String group,
                            com.taobao.gecko.core.buffer.IoBuffer head,
                            com.taobao.gecko.core.buffer.IoBuffer tail,
                            FileChannel channel,
                            long position,
                            long size)
                     throws com.taobao.gecko.service.exception.NotifyRemotingException
指定者:
接口 com.taobao.gecko.service.RemotingController 中的 transferToGroup
抛出:
com.taobao.gecko.service.exception.NotifyRemotingException


Copyright © 2010–2013. All rights reserved.