Class FlyweightEncoderDecoderFactory

java.lang.Object
org.serviceconnector.net.FlyweightEncoderDecoderFactory

public final class FlyweightEncoderDecoderFactory extends Object
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 Details

    • FlyweightEncoderDecoderFactory

      public FlyweightEncoderDecoderFactory()
      Instantiates a new FlyweightEncoderDecoderFactory.
  • Method Details

    • isLarge

      public boolean isLarge(SCMPMessage message)
      Checks if is large.
      Parameters:
      message - the scmp message
      Returns:
      true, if is large
    • createEncoderDecoder

      public IEncoderDecoder createEncoderDecoder(SCMPMessage message)
      New instance.
      Parameters:
      message - the scmp message
      Returns:
      the i encoder decoder
    • createEncoderDecoder

      public IEncoderDecoder createEncoderDecoder(byte[] scmpBuffer)
      New instance.
      Parameters:
      scmpBuffer - the scmp message buffer
      Returns:
      the i encoder decoder