Java Code Examples for org.apache.thrift.TException.printStackTrace()

The following are Jave code examples for showing how to use printStackTrace() of the org.apache.thrift.TException class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: algorithm.annotation   File: AlgorithmClient.java   View Source Code Vote up 5 votes
public Set<String> listAlgorithms(){
	Set<String> ret = null;
	try {
		ret = newClient().listAlgorithms();
		transport.close();
	} catch (TException x) {
		x.printStackTrace();
	}
	return ret;
}
 
Example 2
Project: algorithm.annotation   File: AlgorithmClient.java   View Source Code Vote up 5 votes
public List<String> describeAlgorithm(String name){
	List<String> ret = null;
	try {
		ret = newClient().describeAlgorithm(name);
		transport.close();
	} catch (TException x) {
		x.printStackTrace();
	}
	return ret;
}
 
Example 3
Project: algorithm.annotation   File: AlgorithmClient.java   View Source Code Vote up 5 votes
public Object performAlgorithm(String name, Object... params) {
	Object ret = null;
	try {
		ret = KryoTool.toObject(newClient().performAlgorithm(name, KryoTool.toByteBuffer(params)));
		transport.close();
	} catch (TException x) {
		x.printStackTrace();
	}
	return ret;
}
 
Example 4
Project: CodeBroker   File: ThriftSerializerFactory.java   View Source Code Vote up 5 votes
public ActorMessage getActorMessage(byte[] buffer) {
    BaseByteArrayPacket packet = new BaseByteArrayPacket();
    packet.fromBinary(buffer);
    ActorMessage actorMessage = new ActorMessage();
    try {
        deserializer.deserialize(actorMessage, packet.toBinary());
    } catch (TException e) {
        e.printStackTrace();
    }
    return actorMessage;
}
 
Example 5
Project: CodeBroker   File: ThriftSerializerFactory.java   View Source Code Vote up 5 votes
public RemoteEventMessage getEventMessage(byte[] buffer) {
    RemoteEventMessage event = new RemoteEventMessage();
    try {
        deserializer.deserialize(event, buffer);
    } catch (TException e) {
        e.printStackTrace();
    }
    return event;
}
 
Example 6
Project: CodeBroker   File: ThriftSerializerFactory.java   View Source Code Vote up 5 votes
public byte[] deserializeEventMessage(RemoteEventMessage event) {
    try {
        return serializer.serialize(event);
    } catch (TException e) {
        e.printStackTrace();
        return null;
    }
}
 
Example 7
Project: CodeBroker   File: ThriftSerializerFactory.java   View Source Code Vote up 5 votes
public byte[] getActorMessageByteArray(Operation operation, TBase<?, ?> base) {
    byte[] tbaseMessage = null;
    ActorMessage actorMessage = new ActorMessage();
    actorMessage.op = operation;
    try {
        actorMessage.messageRaw = getTbaseByteBuffer(base);
        tbaseMessage = getOnlySerializerByteArray(actorMessage);
    } catch (TException e) {
        e.printStackTrace();
    }
    return tbaseMessage;
}
 
Example 8
Project: CodeBroker   File: NettyIoSession.java   View Source Code Vote up 5 votes
/**
 * 发送消息
 *
 * @param msg
 */
private void send2SessionActor(Object msg) {
    if (msg instanceof BaseByteArrayPacket) {
        ActorMessage message = new ActorMessage();

        byte[] binary = ((BaseByteArrayPacket) msg).toBinary();
        ByteBuffer buffer = ByteBuffer.allocate(binary.length);
        buffer.put(binary);
        buffer.flip();

        message.messageRaw = buffer;
        message.op = Operation.SESSION_RECIVE_PACKET;
        byte[] actorMessage;
        try {
            actorMessage = thriftSerializerFactory.getActorMessage(message);
            actorRef.tell(actorMessage, ActorRef.noSender());

            CObject newInstance = CObject.newInstance();
            newInstance.putInt(MonitorEventType.KEY, MonitorEventType.SESSEION_RECIVE_FLOW);
            newInstance.putLong(MonitorEventType.SESSION_ID, sessionId);
            newInstance.putDouble(MonitorEventType.SESSION_FLOW, binary.length);
            newInstance.putLong(MonitorEventType.SESSION_TIME, System.currentTimeMillis());
            AkkaUtil.getInbox().send(CodeBrokerSystem.getInstance().getMonitorManager(), newInstance);
        } catch (TException e) {
            e.printStackTrace();
        }

    }
}