Package org.apache.openejb

Examples of org.apache.openejb.OpenEJBRuntimeException


                    initFilteredServiceManager(annotationOld.value());
                }
                serviceManager = new ServiceManagerProxy(false);
                serviceManager.start();
            } catch (final ServiceManagerProxy.AlreadyStartedException e) {
                throw new OpenEJBRuntimeException(e);
            }
        }

        servletContext = new MockServletContext();
        session = new MockHttpSession();
View Full Code Here


        }

        final Class<?> key = method.getReturnType();

        if (!key.isInstance(value)) { // we can't do it in validate to avoid to instantiate the value twice
            throw new OpenEJBRuntimeException(value + " is not an instance of " + key.getName());
        }

        SystemInstance.get().setComponent((Class<Object>) key, value);
    }
View Full Code Here

                } catch (final Exception e) {
                    // ignore
                }
            }
            if (!DataBinding.class.isInstance(instance)) {
                throw new OpenEJBRuntimeException(instance + " is not a " + DataBinding.class.getName()
                    + ", please check configuration of service [id=" + databinding + "]");
            }
            serviceFactory.setDataBinding((DataBinding) instance);
        }
View Full Code Here

        final RecoverableTransactionManager tm;
        if (transactionManager instanceof RecoverableTransactionManager) {
            tm = (RecoverableTransactionManager) transactionManager;
        } else {
            if (txSupport.isRecoverable()) {
                throw new OpenEJBRuntimeException("currently recoverable tx support (xa) needs a geronimo tx manager");
            }
            tm = new SimpleRecoverableTransactionManager(transactionManager);
        }

        if (validationInterval >= 0 && mcf instanceof ValidatingManagedConnectionFactory) {
View Full Code Here

            try {
                if (hessian != null && hessian.serializerFactory() != Object.class && !hessian.serializerFactory().isInstance(server.getSerializerFactory())) {
                    server.serializerFactory(hessian.serializerFactory().newInstance());
                }
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }
            if (hessian != null) {
                server.sendCollectionType(hessian.sendCollectionType());
            }
            if (Dependent.class.equals(deployment.bean.getScope())) {
                LOGGER.warning("@Dependent can lead to memory leaks ATM");
            }
            server.createSkeleton(bm.getReference(deployment.bean, deployment.itf, null), deployment.itf);

            final String name = getName(deployment.path, deployment.itf);
            final String appName = findAppName(bm);
            try {
                LOGGER.info("Hessian(url=" + registry.deploy(deployment.itf.getClassLoader(), server,
                    service.getVirtualHost(), appName,
                    service.getAuthMethod(), service.getTransportGuarantee(),
                    service.getRealmName(), name) + ", interface=" + name + ")");
                deployed.add(new DeployedEndpoint(appName, name));
            } catch (final URISyntaxException e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
        toDeploy.clear();
    }
View Full Code Here

    public HessianServer createSkeleton(final Object instance, final Class<?> itf) {
        try {
            skeleton = loader.loadClass("com.caucho.hessian.server.HessianSkeleton").getConstructor(Object.class, Class.class).newInstance(instance, itf);
        } catch (final Exception e) {
            throw new OpenEJBRuntimeException(e);
        }
        return this;
    }
View Full Code Here

                delegate.invoke(request.getInputStream(), response.getOutputStream());
            } catch (final Throwable throwable) {
                if (Exception.class.isInstance(throwable)) {
                    throw Exception.class.cast(throwable);
                }
                throw new OpenEJBRuntimeException(throwable.getMessage(), throwable);
            }
        }
View Full Code Here

                    // ignore
                }
            }

            if (!DataBinding.class.isInstance(instance)) {
                throw new OpenEJBRuntimeException(instance + " is not a " + DataBinding.class.getName()
                    + ", please check configuration of service [id=" + databinding + "]");
            }
            svrFactory.setDataBinding((DataBinding) instance);
        }
View Full Code Here

    public static List<AbstractFeature> createFeatures(final Collection<ServiceInfo> availableServices, final String featuresIds) {
        final List<?> features = ServiceInfos.resolve(availableServices, featuresIds.split(","));
        for (final Object instance : features) {
            if (!AbstractFeature.class.isInstance(instance)) {
                throw new OpenEJBRuntimeException("feature should inherit from " + AbstractFeature.class.getName());
            }
        }
        return (List<AbstractFeature>) features;
    }
View Full Code Here

    public static List<Interceptor<? extends Message>> createInterceptors(final Collection<ServiceInfo> availableServices, final String ids) {
        final List<?> instances = ServiceInfos.resolve(availableServices, ids.split(","));
        for (final Object instance : instances) {
            if (!Interceptor.class.isInstance(instance)) {
                throw new OpenEJBRuntimeException("interceptors should implement " + Interceptor.class.getName());
            }
        }
        return (List<Interceptor<? extends Message>>) instances;
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.OpenEJBRuntimeException

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.