Package org.cometd.server
Class JettyJSONContextServer
- java.lang.Object
-
- org.cometd.common.JettyJSONContext<ServerMessage.Mutable>
-
- org.cometd.server.JettyJSONContextServer
-
- All Implemented Interfaces:
JSONContext<ServerMessage.Mutable>
,JSONContextServer
public class JettyJSONContextServer extends JettyJSONContext<ServerMessage.Mutable> implements JSONContextServer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.cometd.common.JettyJSONContext
JettyJSONContext.AsyncJSONFactory, JettyJSONContext.AsyncJSONParser, JettyJSONContext.JSONGenerator
-
Nested classes/interfaces inherited from interface org.cometd.common.JSONContext
JSONContext.AsyncParser, JSONContext.Client, JSONContext.Generator, JSONContext.Parser
-
-
Constructor Summary
Constructors Constructor Description JettyJSONContextServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
generate(ServerMessage.Mutable message)
Converts a single message to a JSON string.JSONContext.Generator
getGenerator()
JSONContext.AsyncParser
newAsyncParser()
protected ServerMessage.Mutable
newRoot()
protected ServerMessage.Mutable[]
newRootArray(int size)
-
Methods inherited from class org.cometd.common.JettyJSONContext
generate, getAsyncJSONFactory, getJSON, getParser, parse, parse, putConvertor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cometd.common.JSONContext
generate, getParser, parse, parse
-
-
-
-
Method Detail
-
newRoot
protected ServerMessage.Mutable newRoot()
- Specified by:
newRoot
in classJettyJSONContext<ServerMessage.Mutable>
-
newRootArray
protected ServerMessage.Mutable[] newRootArray(int size)
- Specified by:
newRootArray
in classJettyJSONContext<ServerMessage.Mutable>
-
newAsyncParser
public JSONContext.AsyncParser newAsyncParser()
- Specified by:
newAsyncParser
in interfaceJSONContext<ServerMessage.Mutable>
- Overrides:
newAsyncParser
in classJettyJSONContext<ServerMessage.Mutable>
- Returns:
- a new
JSONContext.AsyncParser
instance, or null if non-blocking parsing is not supported
-
generate
public java.lang.String generate(ServerMessage.Mutable message)
Description copied from interface:JSONContext
Converts a single message to a JSON string.
- Specified by:
generate
in interfaceJSONContext<ServerMessage.Mutable>
- Specified by:
generate
in interfaceJSONContextServer
- Overrides:
generate
in classJettyJSONContext<ServerMessage.Mutable>
- Parameters:
message
- the message to stringify- Returns:
- the JSON string for the message
-
getGenerator
public JSONContext.Generator getGenerator()
- Specified by:
getGenerator
in interfaceJSONContext<ServerMessage.Mutable>
- Overrides:
getGenerator
in classJettyJSONContext<ServerMessage.Mutable>
- Returns:
- a JSON generator to stringify any object to a JSON string
-
-