Package org.serviceconnector.net
Class FlyweightEncoderDecoderFactory
java.lang.Object
org.serviceconnector.net.FlyweightEncoderDecoderFactory
A factory for creating FlyweightEncoderDecoder objects. Factory is based on the Flyweight pattern (http://www.allapplabs.com/java_design_patterns/flyweight_pattern.htm).
EncoderDecoders are only instantiated one time. Factory is always returning the same instance from a map.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new FlyweightEncoderDecoderFactory. -
Method Summary
Modifier and TypeMethodDescriptioncreateEncoderDecoder(byte[] scmpBuffer) New instance.createEncoderDecoder(SCMPMessage message) New instance.booleanisLarge(SCMPMessage message) Checks if is large.
-
Constructor Details
-
FlyweightEncoderDecoderFactory
public FlyweightEncoderDecoderFactory()Instantiates a new FlyweightEncoderDecoderFactory.
-
-
Method Details
-
isLarge
Checks if is large.- Parameters:
message- the scmp message- Returns:
- true, if is large
-
createEncoderDecoder
New instance.- Parameters:
message- the scmp message- Returns:
- the i encoder decoder
-
createEncoderDecoder
New instance.- Parameters:
scmpBuffer- the scmp message buffer- Returns:
- the i encoder decoder
-