@Override public void stop(boolean stopTransports) { try { super.stop(stopTransports); } finally { sharedContext = null; extendedCodecs = null; defaultStoredStrings = null; reflection = null; } }
protected void setAuthenticated(boolean authenticated) { if (!this.authenticating && this.authenticated == authenticated) return; this.authenticating = false; this.authenticated = authenticated; for (ChannelStatusListener listener : statusListeners) listener.authenticatedChanged(this, authenticated); }
@Override public void pingedChanged(Channel channel, boolean pinged) { for (ChannelStatusListener listener : listeners) listener.pingedChanged(channel, pinged); }
/** * Set default time to live on all channels * @param timeToLive time to live in milliseconds */ public void setDefaultTimeToLive(long timeToLive) { defaultTimeToLive = timeToLive; if (channelFactory != null) channelFactory.setDefaultTimeToLive(timeToLive); for (MessagingChannel messagingChannel : messagingChannelsByType.values()) messagingChannel.setDefaultTimeToLive(timeToLive); if (remotingChannel != null) remotingChannel.setDefaultTimeToLive(timeToLive); }
/** * Implementation of login * Should not be called directly, called by {@link org.granite.client.tide.Identity#login} * * @param username user name * @param password password */ public void login(String username, String password) { remotingChannel.setCredentials(new UsernamePasswordCredentials(username, password)); for (MessagingChannel messagingChannel : messagingChannelsByType.values()) messagingChannel.setCredentials(new UsernamePasswordCredentials(username, password)); }
@Override public RemotingChannel newRemotingChannel(String id, URI uri) { return newRemotingChannel(id, uri, RemotingChannel.DEFAULT_MAX_CONCURRENT_REQUESTS); }
@Override public void onStop(Transport transport) { stop(); }
@Override public MessagingChannel newMessagingChannel(String id, String uri) { return newMessagingChannel(defaultChannelType, id, uri); }
@Override public ResponseMessageFuture logout(ResponseListener... listeners) { return logout(true, listeners); }
private void unsetupChannel(Channel channel) { channel.removeListener(channelStatusBinder); channel.unbindStatus(channelStatusBinder); }
/** * Set the default channel builder * @param channelBuilder channel builder */ public void setDefaultChannelBuilder(ChannelBuilder channelBuilder) { this.defaultChannelBuilder = channelBuilder; if (channelFactory != null) channelFactory.setDefaultChannelBuilder(defaultChannelBuilder); }
/** * Set the default channel type for messaging * @param channelType channel type */ public void setDefaultChannelType(String channelType) { this.defaultChannelType = channelType; if (channelFactory != null) channelFactory.setDefaultChannelType(defaultChannelType); }
/** * Current messaging transport * @return messaging transport */ public Transport getMessagingTransport() { return channelFactory != null ? channelFactory.getMessagingTransport() : messagingTransport; }
@Override public void stop(boolean stopTransports) { try { super.stop(stopTransports); } finally { sharedContext = null; extendedCodecs = null; defaultStoredStrings = null; reflection = null; } }
protected void setAuthenticated(boolean authenticated) { if (!this.authenticating && this.authenticated == authenticated) return; this.authenticating = false; this.authenticated = authenticated; for (ChannelStatusListener listener : statusListeners) listener.authenticatedChanged(this, authenticated); }
/** * Implementation of login using a specific charset for username/password encoding * Should not be called directly, called by {@link org.granite.client.tide.Identity#login} * * @param username user name * @param password password * @param charset charset used for encoding */ public void login(String username, String password, Charset charset) { remotingChannel.setCredentials(new UsernamePasswordCredentials(username, password, charset)); for (MessagingChannel messagingChannel : messagingChannelsByType.values()) messagingChannel.setCredentials(new UsernamePasswordCredentials(username, password, charset)); }
protected void setPinged(boolean pinged) { if (this.pinged == pinged) return; this.pinged = pinged; for (ChannelStatusListener listener : statusListeners) listener.pingedChanged(this, pinged); }
@Override public RemotingChannel newRemotingChannel(String id, ServerApp serverApp) { return newRemotingChannel(id, serverApp, RemotingChannel.DEFAULT_MAX_CONCURRENT_REQUESTS); }
@Override public void stop(boolean stopTransports) { try { super.stop(stopTransports); } finally { sharedContext = null; extendedCodecs = null; defaultStoredStrings = null; reflection = null; } }
public void stop() { aliasRegistry = null; stop(true); }