org.apache.camel.dataformat.protobuf
Class ProtobufDataFormat

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.dataformat.protobuf.ProtobufDataFormat
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.DataFormat, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class ProtobufDataFormat
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.CamelContextAware


Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
ProtobufDataFormat()
           
ProtobufDataFormat(com.google.protobuf.Message defaultInstance)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 org.apache.camel.CamelContext getCamelContext()
           
protected  com.google.protobuf.Message loadDefaultInstance(String className, org.apache.camel.CamelContext context)
           
 void marshal(org.apache.camel.Exchange exchange, Object graph, OutputStream outputStream)
           
 void setCamelContext(org.apache.camel.CamelContext camelContext)
           
 void setDefaultInstance(com.google.protobuf.Message instance)
           
 void setDefaultInstance(Object instance)
           
 void setInstanceClass(String className)
           
 Object unmarshal(org.apache.camel.Exchange exchange, InputStream inputStream)
           
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtobufDataFormat

public ProtobufDataFormat()

ProtobufDataFormat

public ProtobufDataFormat(com.google.protobuf.Message defaultInstance)
Method Detail

getCamelContext

public org.apache.camel.CamelContext getCamelContext()
Specified by:
getCamelContext in interface org.apache.camel.CamelContextAware

setCamelContext

public void setCamelContext(org.apache.camel.CamelContext camelContext)
Specified by:
setCamelContext in interface org.apache.camel.CamelContextAware

setDefaultInstance

public void setDefaultInstance(com.google.protobuf.Message instance)

setDefaultInstance

public void setDefaultInstance(Object instance)

setInstanceClass

public void setInstanceClass(String className)
                      throws Exception
Throws:
Exception

marshal

public void marshal(org.apache.camel.Exchange exchange,
                    Object graph,
                    OutputStream outputStream)
             throws Exception
Specified by:
marshal in interface org.apache.camel.spi.DataFormat
Throws:
Exception

unmarshal

public Object unmarshal(org.apache.camel.Exchange exchange,
                        InputStream inputStream)
                 throws Exception
Specified by:
unmarshal in interface org.apache.camel.spi.DataFormat
Throws:
Exception

loadDefaultInstance

protected com.google.protobuf.Message loadDefaultInstance(String className,
                                                          org.apache.camel.CamelContext context)
                                                   throws org.apache.camel.CamelException,
                                                          ClassNotFoundException
Throws:
org.apache.camel.CamelException
ClassNotFoundException

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class org.apache.camel.support.ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class org.apache.camel.support.ServiceSupport
Throws:
Exception


Apache Camel