Grizzly-Blink

Grizzly NIO framework filters to process the Blink protocol serialized messages.

License

License

Categories

Categories

Grizzly Net Networking
GroupId

GroupId

me.cmoz.grizzly
ArtifactId

ArtifactId

grizzly-blink
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Grizzly-Blink
Grizzly NIO framework filters to process the Blink protocol serialized messages.
Project URL

Project URL

http://github.com/novabyte/grizzly-blink
Source Code Management

Source Code Management

https://github.com/novabyte/grizzly-blink

Download grizzly-blink

How to add to project

<!-- https://jarcasting.com/artifacts/me.cmoz.grizzly/grizzly-blink/ -->
<dependency>
    <groupId>me.cmoz.grizzly</groupId>
    <artifactId>grizzly-blink</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/me.cmoz.grizzly/grizzly-blink/
implementation 'me.cmoz.grizzly:grizzly-blink:1.0.0'
// https://jarcasting.com/artifacts/me.cmoz.grizzly/grizzly-blink/
implementation ("me.cmoz.grizzly:grizzly-blink:1.0.0")
'me.cmoz.grizzly:grizzly-blink:jar:1.0.0'
<dependency org="me.cmoz.grizzly" name="grizzly-blink" rev="1.0.0">
  <artifact name="grizzly-blink" type="jar" />
</dependency>
@Grapes(
@Grab(group='me.cmoz.grizzly', module='grizzly-blink', version='1.0.0')
)
libraryDependencies += "me.cmoz.grizzly" % "grizzly-blink" % "1.0.0"
[me.cmoz.grizzly/grizzly-blink "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.5
org.glassfish.grizzly : grizzly-framework jar 2.3.5

test (3)

Group / Artifact Type Version
org.mockito : mockito-core jar 1.9.5
org.slf4j : slf4j-simple jar 1.7.5
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Grizzly-Blink

Grizzly NIO framework filters to process the Blink protocol serialized messages.

Grizzly-Blink is created and maintained by Chris Molozian (@novabyte).
Code licensed under the Apache License v2.0. Documentation licensed under CC BY 3.0.

Usage

Grizzly-Blink is available on Maven Central.

<dependency>
    <groupId>me.cmoz.grizzly</groupId>
    <artifactId>grizzly-blink</artifactId>
    <version>1.0.0</version>
</dependency>

If you're not using Maven (or a dependency resolver that's compatible with Maven repositories), you can download the JARs you need for your project from Maven Central.

Filter Types

At the moment there is only one filter to choose from: BlinkCompactFilter. This filter implements the Blink Compact protocol.

There are future plans to add support for the Blink Native version of the Blink protocol specification once support for it is added to jblink.

Example

The filter needs a Schema type to use to encode and decode messages.

The example below demonstrates the Hello protocol, all messages sent/received by the filter chain will (de)serialize to the Hello protocol format:

final Schema schema = new Schema();
SchemaReader.readFromString(
        "namespace HelloSpec\n" +
        "Hello/1 ->\n" +
        "  string Greeting", schema);
schema.finalizeSchema();

final FilterChainBuilder serverFilterBuilder = FilterChainBuilder.stateless()
        .add(new TransportFilter())
        .add(new BlinkCompactFilter(schema, "some.package.for.blink.code"))

For more detailed examples of how to integrate this filter into your code have a look at the test cases.

Developer Notes

The codebase requires the Gradle build tool at version 1.6+ and the Java compiler at version 1.6.0 or greater.

The main external dependency for the project is Grizzly NIO, at 2.3.5 or greater. At the moment jblink is being bundled within this library until it's packaged properly and available on Maven Central.

For a full list of dependencies see the build script. All dependencies are downloaded by Gradle during the build process.

Building the codebase

The codebase requires NodeJS to use the blinkc compiler, it generates source files that map the protocol specification to Java (similarly to how Protobuf-Java works). You'll also need to clone the repository with all git submodules to include the blinkc.js dependency:

git clone --recursive git://github.com/novabyte/grizzly-blink.git

A list of all possible build targets can be displayed by Gradle with gradle tasks.

In a regular write-compile-test cycle use gradle test.

A list of all project dependencies can be displayed by Gradle with gradle dependencies.

It is recommended to run Gradle with the Build Daemon enabled to improve performance. e.g. gradle --daemon once the daemon is running it can be stopped with gradle --stop.

Contribute

All contributions to the documentation and the codebase are very welcome. Feel free to open issues on the tracker wherever the documentation needs improving.

Also, pull requests are always welcome! :)

Versions

Version
1.0.0