com.pusher.client.util.Factory.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pusher-java-client Show documentation
Show all versions of pusher-java-client Show documentation
This is a Java client library for Pusher, targeted at core Java and Android.
Factory (Pusher Java Websocket API)
com.pusher.client.util
Class Factory
- java.lang.Object
-
- com.pusher.client.util.Factory
-
public class Factory
extends java.lang.Object
This is a lightweight way of doing dependency injection and enabling classes
to be unit tested in isolation. No class in this library instantiates another
class directly, otherwise they would be tightly coupled. Instead, they all
call the factory methods in this class when they want to create instances of
another class.
An instance of Factory is provided on construction to each class which may
require it, the initial factory is instantiated in the Pusher constructor,
the only constructor which a library consumer should need to call directly.
Conventions:
- any method that starts with "new", such as
newPublicChannel(String)
creates a new instance of that class every
time it is called.
- any method that starts with "get", such as getEventQueue()
returns
a singleton. These are lazily constructed and their access methods should be
synchronized for this reason.
-
-
Constructor Summary
Constructors
Constructor and Description
Factory()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
com.pusher.client.channel.impl.ChannelManager
getChannelManager()
com.pusher.client.connection.impl.InternalConnection
getConnection(java.lang.String apiKey,
PusherOptions options)
java.util.concurrent.ExecutorService
getEventQueue()
java.util.concurrent.ScheduledExecutorService
getTimers()
com.pusher.client.channel.impl.PresenceChannelImpl
newPresenceChannel(com.pusher.client.connection.impl.InternalConnection connection,
java.lang.String channelName,
Authorizer authorizer)
com.pusher.client.channel.impl.PrivateChannelImpl
newPrivateChannel(com.pusher.client.connection.impl.InternalConnection connection,
java.lang.String channelName,
Authorizer authorizer)
com.pusher.client.channel.impl.ChannelImpl
newPublicChannel(java.lang.String channelName)
org.java_websocket.client.WebSocketClient
newWebSocketClientWrapper(java.net.URI uri,
java.net.Proxy proxy,
com.pusher.client.connection.websocket.WebSocketListener webSocketListener)
void
shutdownThreads()
-
-
Constructor Detail
-
Factory
public Factory()
-
Method Detail
-
getConnection
public com.pusher.client.connection.impl.InternalConnection getConnection(java.lang.String apiKey,
PusherOptions options)
-
newWebSocketClientWrapper
public org.java_websocket.client.WebSocketClient newWebSocketClientWrapper(java.net.URI uri,
java.net.Proxy proxy,
com.pusher.client.connection.websocket.WebSocketListener webSocketListener)
throws javax.net.ssl.SSLException
- Throws:
javax.net.ssl.SSLException
-
getEventQueue
public java.util.concurrent.ExecutorService getEventQueue()
-
getTimers
public java.util.concurrent.ScheduledExecutorService getTimers()
-
newPublicChannel
public com.pusher.client.channel.impl.ChannelImpl newPublicChannel(java.lang.String channelName)
-
newPrivateChannel
public com.pusher.client.channel.impl.PrivateChannelImpl newPrivateChannel(com.pusher.client.connection.impl.InternalConnection connection,
java.lang.String channelName,
Authorizer authorizer)
-
newPresenceChannel
public com.pusher.client.channel.impl.PresenceChannelImpl newPresenceChannel(com.pusher.client.connection.impl.InternalConnection connection,
java.lang.String channelName,
Authorizer authorizer)
-
getChannelManager
public com.pusher.client.channel.impl.ChannelManager getChannelManager()
-
shutdownThreads
public void shutdownThreads()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy