Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To create a new protocol handler AbstractProtocolHandler must be extended (or IProtocolHandler implemented). Two constructors are needed. A default constructor for OSGi and a constructor with the arguments in the codeblock below. The super constructor needs to be called with these arguements, they are needed for the connection of the transport-, protocol- and data-handler.

Code Block
languagejava
public YourProtocolHandler() {
		super();
	} 
 
public YourProtocolHandler(ITransportDirection direction, IAccessPattern access, OptionMap options,
			IStreamObjectDataHandler<T> dataHandler) {
		super(direction, access, dataHandler, options);
	}   
 
/**
     * Creates a new protocol handler
     * @param direction is this handler used in a source (IN) or in a sink (OUT)
     * @param access which kind of access pattern is supported (  PUSH,  PULL,  ROBUST_PUSH,  ROBUST_PULL)
     * @param options set of options as key value pairs
     * @param dataHandler the data handler thats connected to the protocol handler
     * @return
     */
    public IProtocolHandler<T> createInstance(ITransportDirection direction, IAccessPattern access,
            Map<String, String> options, IDataHandler<T> dataHandler) {
return new YourProtocolHandler<>(direction, access, options, dataHandler);
}

 

The following method could be overwritten:

...