Package hermes.impl

Examples of hermes.impl.ClassLoaderManager


                boolean deleted = false;
                final WatchInfo info = watchModel.getRow(i);

                try
                {
                    ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class) ;
                    Thread.currentThread().setContextClassLoader(classLoaderManager.getClassLoaderByHermes(info.getHermesId())) ;
                   
                    Hermes hermes = null;

                    if (!hermesToClose.keySet().contains(info.getHermesId()))
                    {
View Full Code Here


      
       //
       // Create and populate the context bean...
      
       JNDIContextFactory contextBean = new JNDIContextFactory() ;
       ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class) ;
      
       contextBean._setDelegateClassLoader(classLoaderManager.getClassLoader(namingConfig.getClasspathId())) ;
     
       LoaderSupport.populateBean(contextBean, namingConfig.getProperties()) ;
      
       Context rootContext = contextBean.createContext() ;
      
View Full Code Here

      super();
   }

   public JNDIContextFactory(NamingConfig namingConfig) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, IOException
   {
      ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class);

      _setDelegateClassLoader(classLoaderManager.getClassLoader(namingConfig.getClasspathId()));

      LoaderSupport.populateBean(this, namingConfig.getProperties());
   }
View Full Code Here

      cfComboModel.addListDataListener(new ListDataListener()
      {
         public void contentsChanged(ListDataEvent arg0)
         {
            final String className = HermesBrowser.getConfigDAO().getAdminClassForPlugIn((String) cfComboModel.getSelectedItem());
            final ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class);

            try
            {
               if (propertyTableModel != null)
               {
                  final ClassLoader classLoader = classLoaderManager.getClassLoader(dialog.getSelectedLoader());
                  Thread.currentThread().setContextClassLoader(classLoader);

                  bean = (HermesAdminFactory) classLoader.loadClass(className).newInstance();
                  propertyTableModel.setBean(bean);
                  updateCellEditor();
View Full Code Here

      cfComboModel.setSelectedItem(HermesBrowser.getConfigDAO().getPlugInName(config.getClassName()));

      try
      {
         ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class);
         ClassLoader classLoader = classLoaderManager.getClassLoader(classPathId);
         Thread.currentThread().setContextClassLoader(classLoader);

         bean = (HermesAdminFactory) classLoader.loadClass(config.getClassName()).newInstance();
      }
      catch (Throwable e)
View Full Code Here

        final String className = (String) connectionFactoryComboBoxModel.getSelectedItem();

        try {
          if (propertyTableModel != null) {
            String classLoaderId = (String) classLoaderComboBox.getSelectedItem();
            ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class);
            ClassLoader classLoader = classLoaderManager.getClassLoader(classLoaderId);

            bean = ReflectUtils.createConnectionFactory(classLoader.loadClass(className));

            propertyTableModel.setBean(bean);
            updateCellEditor();
View Full Code Here

  }

  private void updateConectionFactories() {
    String classpathGroupId = (String) classLoaderComboBox.getSelectedItem();
    ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class);
    if (classpathGroupId == null) {
      classpathGroupId = factoryConfig.getClasspathId();
    }

    Set<String> factories = new HashSet<String>();

    if (classLoaderManager.getFactories(classpathGroupId) != null) {
      factories.addAll(classLoaderManager.getFactories(classpathGroupId));
    }

    factories.addAll(defaultFactories);

    connectionFactoryComboBoxModel.removeAllElements();
View Full Code Here

    if (factoryConfig.getClasspathId() == null) {
      factoryConfig.setClasspathId(SimpleClassLoaderManager.SYSTEM_LOADER);
    }

    final DefaultComboBoxModel classLoaderModel = new DefaultComboBoxModel();
    final ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class);

    for (Iterator iter = classLoaderManager.getIds().iterator(); iter.hasNext();) {
      classLoaderModel.addElement(iter.next());
    }

    classLoaderModel.addElement(SimpleClassLoaderManager.SYSTEM_LOADER);

    classLoaderComboBox.setModel(classLoaderModel);
    classLoaderComboBox.setSelectedItem(factoryConfig.getClasspathId());

    updateConectionFactories();

    classLoaderModel.addListDataListener(new ListDataListener() {
      @Override
      public void contentsChanged(ListDataEvent e) {
        try {
          updateConectionFactories();
        } catch (Exception ex) {
          log.error(ex.getMessage(), ex);
        }
      }

      @Override
      public void intervalAdded(ListDataEvent e) {
        // NOP
      }

      @Override
      public void intervalRemoved(ListDataEvent e) {
        // NOP
      }
    });

    ConnectionFactory bean = null;

    ClassLoader classLoader = getClass().getClassLoader();

    try {
      Class clazz = classLoaderManager.getClassLoader(factoryConfig.getClasspathId()).loadClass(factoryConfig.getProvider().getClassName());
      bean = ReflectUtils.createConnectionFactory(clazz);
    } catch (Throwable e) {
      log.error(e.getMessage(), e);
      HermesBrowser.getBrowser().showErrorDialog("Cannot find class " + factoryConfig.getProvider().getClassName() + " in loader " + factoryConfig.getClasspathId());
    }
View Full Code Here

TOP

Related Classes of hermes.impl.ClassLoaderManager

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.