本文整理汇总了Java中org.apache.thrift.transport.TTransportException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java TTransportException.printStackTrace方法的具体用法?Java TTransportException.printStackTrace怎么用?Java TTransportException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.thrift.transport.TTransportException
的用法示例。
在下文中一共展示了TTransportException.printStackTrace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: userProfileClient
import org.apache.thrift.transport.TTransportException; //导入方法依赖的package包/类
public static UserProfileService.Client userProfileClient(String serverHost, int serverPort) throws Exception{
try {
TTransport transport = new TSocket(serverHost, serverPort);
transport.open();
TProtocol protocol = new TBinaryProtocol(transport);
TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, "UserProfileService");
return new UserProfileService.Client(multiplexedProtocol);
} catch (TTransportException e) {
e.printStackTrace();
throw new Exception("Could not connect to user profile server");
}
}
示例2: NaviHiveClientDriver
import org.apache.thrift.transport.TTransportException; //导入方法依赖的package包/类
public NaviHiveClientDriver(ServerUrlUtil.ServerUrl server, String auth,
NaviPoolConfig poolConfig) {
super(server, auth, poolConfig);
try {
transport = new TSocket(server.getHost(), server.getPort());
TProtocol protocol = new TBinaryProtocol(transport);
client = new HiveClient(protocol);
transport.open();
} catch (TTransportException e) {
e.printStackTrace();
}
}
示例3: open
import org.apache.thrift.transport.TTransportException; //导入方法依赖的package包/类
public boolean open() {
if (!transport.isOpen()) {
try {
transport.open();
} catch (TTransportException e) {
e.printStackTrace();
return false;
}
}
return true;
}