Package com.caucho.hessian.io

Examples of com.caucho.hessian.io.SerializerFactory


            OutputStream os = response.getOutputStream();

            Hessian2Input in = new Hessian2Input(is);
            AbstractHessianOutput out;

            SerializerFactory serializerFactory = getSerializerFactory();

            in.setSerializerFactory(serializerFactory);

            int code = in.read();
View Full Code Here


        DataChannel channel = runtime.getChannel();

        RemoteService service = runtime.getInjector().getInstance(RemoteService.class);

        SerializerFactory serializerFactory = HessianConfig.createFactory(
                HessianService.SERVER_SERIALIZER_FACTORIES,
                channel.getEntityResolver());

        setAPIClass(RemoteService.class);
        setSerializerFactory(serializerFactory);
View Full Code Here

   * <p>This will typically be passed in as an inner bean definition
   * of type <code>com.caucho.hessian.io.SerializerFactory</code>,
   * with custom bean property values applied.
   */
  public void setSerializerFactory(SerializerFactory serializerFactory) {
    this.serializerFactory = (serializerFactory != null ? serializerFactory : new SerializerFactory());
  }
View Full Code Here

     */
    public static SerializerFactory createFactory(
            String[] factoryNames,
            EntityResolver resolver) {

        SerializerFactory factory = new SerializerFactory();

        if (factoryNames != null && factoryNames.length > 0) {

            for (String factoryName : factoryNames) {

                try {
                    factory.addFactory(loadFactory(factoryName, resolver));
                }
                catch (Exception e) {
                    throw new CayenneRuntimeException("Error configuring factory class "
                            + factoryName, e);
                }
View Full Code Here

    @Test
    public void client() throws MalformedURLException {
        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final HessianWebService client = HessianWebService.class.cast(clientFactory.create(HessianWebService.class, "http://127.0.0.1:" + port + "/HessianServiceTest/hessian/" + MyHessianWebService.class.getSimpleName()));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
View Full Code Here

    @Test
    public void client() throws MalformedURLException {
        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final CdiService client = CdiService.class.cast(clientFactory.create(CdiService.class, "http://127.0.0.1:" + port + "/web/hessian/service"));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
View Full Code Here

    @Test
    public void client() throws MalformedURLException {
        final ClassLoader loader = Thread.currentThread().getContextClassLoader();
        final HessianProxyFactory clientFactory = new HessianProxyFactory(loader);
        final SerializerFactory factory = new SerializerFactory(loader);
        factory.setAllowNonSerializable(true);
        clientFactory.setSerializerFactory(factory);
        final CdiService client = CdiService.class.cast(clientFactory.create(CdiService.class, "http://127.0.0.1:" + port + "/web/hessian/foo"));

        final Out out = client.call(new In("test"));
        assertThat(out, instanceOf(Out.class));
View Full Code Here

     */
    public static SerializerFactory createFactory(
            String[] factoryNames,
            EntityResolver resolver) {

        SerializerFactory factory = new SerializerFactory();

        if (factoryNames != null && factoryNames.length > 0) {

            for (String factoryName : factoryNames) {

                try {
                    factory.addFactory(loadFactory(factoryName, resolver));
                }
                catch (Exception e) {
                    throw new CayenneRuntimeException("Error configuring factory class "
                            + factoryName, e);
                }
View Full Code Here

    /**
     * Gets the serializer factory.
     */
    public SerializerFactory getSerializerFactory() {
        if (_serializerFactory == null)
            _serializerFactory = new SerializerFactory();

        return _serializerFactory;
    }
View Full Code Here

     */
    public static SerializerFactory createFactory(
            String[] factoryNames,
            EntityResolver resolver) {

        SerializerFactory factory = new SerializerFactory();

        if (factoryNames != null && factoryNames.length > 0) {

            for (int i = 0; i < factoryNames.length; i++) {

                try {
                    factory.addFactory(loadFactory(factoryNames[i], resolver));
                }
                catch (Exception e) {
                    throw new CayenneRuntimeException("Error configuring factory class "
                            + factoryNames[i], e);
                }
View Full Code Here

TOP

Related Classes of com.caucho.hessian.io.SerializerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.