public static final String TYPE_CHANNEL = "channel";
public static final String TYPE_SESSION = "session";
protected Object execute(Object thiz, Object[] args) throws Exception {
final String type = (String) args[0];
final MessagingService msgService = BBMPlatformNamespace.getInstance().getMessagingService();
if(type.equals(TYPE_CHANNEL)) {
final ConnectionListenerImpl connListenerImpl = new ConnectionListenerImpl();
final BBMPlatformChannelListener channelListener = new ChannelListener(connListenerImpl);
final BBMPlatformChannel channel = msgService.createChannel(channelListener);
ChannelObject connObj = new ChannelObject(channel, true);
connListenerImpl.setConnectionObject(connObj);
return connObj;
} else if(type.equals(TYPE_SESSION)) {
final ConnectionListenerImpl connListenerImpl = new ConnectionListenerImpl();
final BBMPlatformSessionListener sessionListener = new SessionListener(connListenerImpl);
final BBMPlatformSession session = msgService.createSession(sessionListener);
SessionObject connObj = new SessionObject(session, true);
connListenerImpl.setConnectionObject(connObj);
return connObj;
} else {