use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.
the class RssClientSOContainer method receiveFeed.
public RssFeed receiveFeed(String feedPath) throws IOException {
RssFeed feed = null;
final ISynchAsynchConnection connection = getConnection();
synchronized (connection) {
if (connection.isConnected()) {
try {
feed = FeedParser.parse((byte[]) connection.sendSynch(null, feedPath.getBytes()));
} catch (final ParseException e) {
throw new IOException(e.getMessage());
}
}
}
return feed;
}
use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.
the class RssClientSOContainer method createConnection.
protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
trace("createConnection:" + remoteSpace + ":" + data);
// Object[] args = { new Integer(keepAlive) };
final ISynchAsynchConnection conn = new HttpClient(receiver);
return conn;
}
use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.
the class SSLClientSOContainer method createConnection.
/**
* @param remoteSpace remote space
* @param data data
* @return ISynchAsynchConnection a non-<code>null</code> instance.
* @throws ConnectionCreateException not thrown by this implementation.
*/
protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
// $NON-NLS-1$ //$NON-NLS-2$
debug("createClientConnection:" + remoteSpace + ":" + data);
ISynchAsynchConnection conn = new SSLClient(receiver, keepAlive);
return conn;
}
use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.
the class TCPClientSOContainer method createConnection.
/**
* @param remoteSpace remote space
* @param data and data
* @return ISynchAsynchConnection a non-<code>null</code> instance.
* @throws ConnectionCreateException not thrown by this implementation.
*/
protected ISynchAsynchConnection createConnection(ID remoteSpace, Object data) throws ConnectionCreateException {
// $NON-NLS-1$ //$NON-NLS-2$
debug("createClientConnection:" + remoteSpace + ":" + data);
ISynchAsynchConnection conn = new Client(receiver, keepAlive);
return conn;
}
use of org.eclipse.ecf.provider.comm.ISynchAsynchConnection in project ecf by eclipse.
the class XMPPContainer method disconnect.
/*
* (non-Javadoc)
*
* @see org.eclipse.ecf.provider.generic.ClientSOContainer#disconnect()
*/
public void disconnect() {
final ID groupID = getConnectedID();
fireContainerEvent(new ContainerDisconnectingEvent(this.getID(), groupID));
synchronized (getConnectLock()) {
// If we are currently connected
if (isConnected()) {
XmppPlugin.getDefault().unregisterService(this);
final ISynchAsynchConnection conn = getConnection();
synchronized (conn) {
synchronized (getGroupMembershipLock()) {
handleLeave(groupID, conn);
}
}
}
this.connection = null;
remoteServerID = null;
accountManager.setConnection(null);
chatRoomManager.setConnection(null, null, null);
outgoingFileTransferContainerAdapter.setConnection(null);
presenceHelper.disconnect();
getSharedObjectManager().removeSharedObject(presenceHelperID);
}
// notify listeners
fireContainerEvent(new ContainerDisconnectedEvent(this.getID(), groupID));
}
Aggregations