當前位置: 首頁>>代碼示例>>Java>>正文


Java TTransport.isOpen方法代碼示例

本文整理匯總了Java中org.apache.thrift.transport.TTransport.isOpen方法的典型用法代碼示例。如果您正苦於以下問題:Java TTransport.isOpen方法的具體用法?Java TTransport.isOpen怎麽用?Java TTransport.isOpen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.thrift.transport.TTransport的用法示例。


在下文中一共展示了TTransport.isOpen方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: requestTransport

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
protected TProtocol requestTransport(String url) throws TTransportException {

        // probably not thread safe, but we need it? Not atm.

        TTransport act;

        if (!activeTransports.containsKey(url)) {
        	logger.log(Level.DEBUG ,"Creating new transport for: " + url);
            activeTransports.put(url, new THttpClient(url));
        }

        act = activeTransports.get(url);

        if (!act.isOpen()) {
            act.open();
        }
        // THINK: always create new protocol?
        return new TJSONProtocol(act);
    }
 
開發者ID:Ericsson,項目名稱:CodeCheckerEclipsePlugin,代碼行數:20,代碼來源:ThriftTransportFactory.java

示例2: onRemoval

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
@Override
public void onRemoval(RemovalNotification<DeviceId, Pair<TTransport, Bmv2DeviceThriftClient>> notification) {
    // close the transport connection
    Bmv2DeviceThriftClient client = notification.getValue().getRight();
    TTransport transport = notification.getValue().getLeft();
    // Locking here is ugly, but needed (see SafeThriftClient).
    synchronized (transport) {
        if (transport.isOpen()) {
            transport.close();
        }
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:13,代碼來源:Bmv2ControllerImpl.java

示例3: isOpen

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
@Override
public boolean isOpen() {
    for (TTransport transport : transports) {
        if (!transport.isOpen()) {
            return false;
        }
    }

    return true;
}
 
開發者ID:uber-java,項目名稱:tally,代碼行數:11,代碼來源:TMultiUdpClient.java

示例4: validateObject

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
@Override
public boolean validateObject(TServiceClient client) {
    TTransport pin = client.getInputProtocol().getTransport();
    logger.info("validateObject input:{}", pin.isOpen());
    TTransport pout = client.getOutputProtocol().getTransport();
    logger.info("validateObject output:{}", pout.isOpen());
    return pin.isOpen() && pout.isOpen();
}
 
開發者ID:somewhereMrli,項目名稱:albedo-thrift,代碼行數:9,代碼來源:ThriftClientPoolFactory.java

示例5: open

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
private void open( TProtocol protocol ) throws TTransportException {
    if ( protocol != null ) {
        TTransport transport = protocol.getTransport();
        if ( transport != null && ! transport.isOpen() ) {
            transport.open();
        }
    }
}
 
開發者ID:dneves,項目名稱:thrift-ui-fx,代碼行數:9,代碼來源:MethodRequestController.java

示例6: close

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
private void close( TProtocol protocol ) {
    if ( protocol != null ) {
        TTransport transport = protocol.getTransport();
        if ( transport != null && transport.isOpen() ) {
            transport.close();
        }
    }
}
 
開發者ID:dneves,項目名稱:thrift-ui-fx,代碼行數:9,代碼來源:MethodRequestController.java

示例7: destroyObject

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
@Override
public void destroyObject(ThriftServerInfo info, PooledObject<TTransport> p)
        throws Exception {
    TTransport transport = p.getObject();
    if (transport != null && transport.isOpen()) {
        transport.close();
        logger.trace("close thrift connection:{}", info);
    }
}
 
開發者ID:ngayngo9x,項目名稱:q-thrift,代碼行數:10,代碼來源:DefaultThriftConnectionPoolImpl.java

示例8: get

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
@Override
public String get(String arg) throws STException {
	TTransport transport = oprot_.getTransport();
	try {
		if (!transport.isOpen())
			transport.open();
		LOG.debug("Transport is open .");
		sendGet(arg);
		return recvGet();
	} catch (TException e) {
		transport.close();
		LOG.debug("Transport is close .");
		throw new STException("Execute failed !", e);
	}
}
 
開發者ID:venwyhk,項目名稱:ikasoa,代碼行數:16,代碼來源:ServiceClientImpl.java

示例9: destroy

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
public void destroy() throws NaviSystemException {
    TTransport transport = client.getInputProtocol().getTransport();
    if (transport != null && transport.isOpen()) {
        transport.close();
        log.info("scribe client is closed successfully!");
    }
    client = null;
}
 
開發者ID:sunguangran,項目名稱:navi,代碼行數:9,代碼來源:NaviScribeDriver.java

示例10: destroyObject

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
@Override
public void destroyObject(PooledObject<TTransport> p) throws Exception {

    try {
        TTransport transport = p.getObject();
        if (transport.isOpen()) {
            transport.close();
        }
    } catch (Exception e) {
        LOGGER.error("destroy transport object fail.maybe exist memory leek.e:", e);
        throw new OureaException("destroy transport object fail" + e.getMessage());
    }

}
 
開發者ID:ketao1989,項目名稱:ourea,代碼行數:15,代碼來源:ConsumerPoolFactory.java

示例11: isAlive

import org.apache.thrift.transport.TTransport; //導入方法依賴的package包/類
public boolean isAlive() throws NaviSystemException {
    TTransport transport = client.getInputProtocol().getTransport();
    return transport.isOpen();
}
 
開發者ID:sunguangran,項目名稱:navi,代碼行數:5,代碼來源:NaviScribeDriver.java


注:本文中的org.apache.thrift.transport.TTransport.isOpen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。