private Class load(final String className, final String messageCode) throws OpenEJBException { try { return Class.forName(className, true, moduleContext.getClassLoader()); } catch (final ClassNotFoundException e) { final String message = SafeToolkit.messages.format("cl0007", className, bean.codebase); throw new OpenEJBException(AssemblerTool.messages.format(messageCode, className, bean.ejbDeploymentId, message)); } } }
private URL toUrl(final String jarPath) throws OpenEJBException { try { return new File(jarPath).toURI().toURL(); } catch (final MalformedURLException e) { throw new OpenEJBException(messages.format("cl0001", jarPath, e.getMessage()), e); } }
private static void checkSource(final File file) throws DeploymentTerminatedException { if (!file.exists()) { throw new DeploymentTerminatedException(messages.format("cmd.deploy.fileNotFound", file.getAbsolutePath())); } }
protected static void checkImplementation(final Class intrfce, final Class factory, final String serviceType, final String serviceName) throws OpenEJBException { if (!intrfce.isAssignableFrom(factory)) { throw new OpenEJBException(messages.format("init.0100", serviceType, serviceName, factory.getName(), intrfce.getName())); } }
private static void checkSource(final File file) throws DeploymentTerminatedException { if (!file.exists()) { throw new DeploymentTerminatedException(messages.format("cmd.deploy.fileNotFound", file.getAbsolutePath())); } }
private static void checkDest(final File destFile, final File file) throws DeploymentTerminatedException { if (destFile.exists()) { throw new DeploymentTerminatedException(messages.format("cmd.deploy.destExists", file.getAbsolutePath(), destFile.getAbsolutePath())); } }
private static void checkDest(File destFile, File file) throws DeploymentTerminatedException { if (destFile.exists()){ throw new DeploymentTerminatedException(messages.format("cmd.deploy.destExists", file.getAbsolutePath(), destFile.getAbsolutePath())); } }
protected static void checkImplementation(Class intrfce, Class factory, String serviceType, String serviceName) throws OpenEJBException { if (!intrfce.isAssignableFrom(factory)) { throw new OpenEJBException(messages.format("init.0100", serviceType, serviceName, factory.getName(), intrfce.getName())); } }
private static void copyFile(final File file, final File destFile) throws DeploymentTerminatedException { try { IO.copy(file, destFile); } catch (final Exception e) { throw new DeploymentTerminatedException(messages.format("cmd.deploy.cantCopy", file.getAbsolutePath(), destFile.getAbsolutePath())); } }
private static void copyFile(final File file, final File destFile) throws DeploymentTerminatedException { try { IO.copy(file, destFile); } catch (final Exception e) { throw new DeploymentTerminatedException(messages.format("cmd.deploy.cantCopy", file.getAbsolutePath(), destFile.getAbsolutePath())); } }
private void bindService(final ServiceInfo serviceInfo, final Object service) throws OpenEJBException { try { this.containerSystem.getJNDIContext().bind(JAVA_OPENEJB_NAMING_CONTEXT + serviceInfo.service + "/" + serviceInfo.id, service); } catch (final NamingException e) { throw new OpenEJBException(messages.format("assembler.cannotBindServiceWithId", serviceInfo.service, serviceInfo.id), e); } }
private Class load(final String className, final String messageCode) throws OpenEJBException { try { return Class.forName(className, true, moduleContext.getClassLoader()); } catch (final ClassNotFoundException e) { final String message = messages().format("cl0007", className, bean.codebase); throw new OpenEJBException(messages().format(messageCode, className, bean.ejbDeploymentId, message)); } } }
protected static void checkImplementation(final Class intrfce, final Class factory, final String serviceType, final String serviceName) throws OpenEJBException { if (!intrfce.isAssignableFrom(factory)) { throw new OpenEJBException(new Messages("org.apache.openejb.util.resources").format("init.0100", serviceType, serviceName, factory.getName(), intrfce.getName())); } }
protected Class<?> loadClass(final String clazz) throws OpenEJBException { final ClassLoader cl = module.getClassLoader(); try { return Class.forName(clazz, false, cl); } catch (final ClassNotFoundException cnfe) { throw new OpenEJBException(SafeToolkit.messages.format("cl0007", clazz, module.getJarLocation()), cnfe); } } }
protected Class<?> loadClass(final ClassLoader cl, final String clazz) throws OpenEJBException { try { return Class.forName(clazz, false, cl == null ? module.getClassLoader() : cl); } catch (final ClassNotFoundException cnfe) { throw new OpenEJBException( new Messages("org.apache.openejb.util.resources").format("cl0007", clazz, module.getJarLocation()), cnfe); } } }
public ContainerInfo createContainerInfo(final Container container) throws OpenEJBException { final Class<? extends ContainerInfo> infoClass = getContainerInfoType(container.getType()); if (infoClass == null) { throw new OpenEJBException(messages.format("unrecognizedContainerType", container.getType())); } return configureService(container, infoClass); }
public ContainerInfo createContainerInfo(final Container container) throws OpenEJBException { final Class<? extends ContainerInfo> infoClass = getContainerInfoType(container.getType()); if (infoClass == null) { throw new OpenEJBException(messages.format("unrecognizedContainerType", container.getType())); } return configureService(container, infoClass); }
public ContainerInfo createContainerInfo(Container container) throws OpenEJBException { Class<? extends ContainerInfo> infoClass = getContainerInfoType(container.getType()); if (infoClass == null) { throw new OpenEJBException(messages.format("unrecognizedContainerType", container.getType())); } ContainerInfo info = configureService(container, infoClass); return info; }
public static ServiceProvider getServiceProvider(String id) throws OpenEJBException { ProviderInfo info = getProviderInfo(id); List<ServiceProvider> services = getServiceProviders(info.getPackageName()); for (ServiceProvider service : services) { if (service.getId().equals(info.getServiceName())) { return service; } } throw new NoSuchProviderException(messages.format("conf.4901", info.getServiceName(), info.getPackageName())); }
public static ServiceProvider getServiceProvider(final String idString) throws OpenEJBException { final ID id = ID.parse(idString, currentDefaultProviderUrl(DEFAULT_PROVIDER_URL)); { final ServiceProvider provider = getManager().get(id.getNamespace(), id.getName()); if (provider != null) { return provider; } } throw new NoSuchProviderException(messages.format("conf.4901", id.getName(), id.getNamespace())); }