JBoss Tools SVN: r18738 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-18 10:58:52 -0500 (Wed, 18 Nov 2009)
New Revision: 18738
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5223
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java 2009-11-18 14:53:21 UTC (rev 18737)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java 2009-11-18 15:58:52 UTC (rev 18738)
@@ -181,16 +181,16 @@
String packageName = projectName.toLowerCase();
if(packageName.indexOf(" ") >= 0)
- packageName = packageName.replaceAll(" ", "");
+ packageName = packageName.replace(" ", "");
if(packageName.indexOf("-") >= 0)
- packageName = packageName.replaceAll("-", "");
+ packageName = packageName.replace("-", "");
if(packageName.indexOf("+") >= 0)
- packageName = packageName.replaceAll("+", "");
+ packageName = packageName.replace("+", "");
if(packageName.indexOf("_") >= 0)
- packageName = packageName.replaceAll("_", "");
+ packageName = packageName.replace("_", "");
while(packageName.indexOf("..") >= 0){
packageName = packageName.replace("..", ".");
15 years, 1 month
JBoss Tools SVN: r18737 - trunk/birt/docs/en/images/hibernate_datasource.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2009-11-18 09:53:21 -0500 (Wed, 18 Nov 2009)
New Revision: 18737
Added:
trunk/birt/docs/en/images/hibernate_datasource/finalReport.png
Log:
Added: trunk/birt/docs/en/images/hibernate_datasource/finalReport.png
===================================================================
(Binary files differ)
Property changes on: trunk/birt/docs/en/images/hibernate_datasource/finalReport.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 1 month
JBoss Tools SVN: r18736 - trunk/birt/docs/en/images/birt_reports_deployment.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2009-11-18 09:52:35 -0500 (Wed, 18 Nov 2009)
New Revision: 18736
Added:
trunk/birt/docs/en/images/birt_reports_deployment/productReport.png
Log:
Added: trunk/birt/docs/en/images/birt_reports_deployment/productReport.png
===================================================================
(Binary files differ)
Property changes on: trunk/birt/docs/en/images/birt_reports_deployment/productReport.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 1 month
JBoss Tools SVN: r18735 - in trunk/as/docs/reference/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-18 09:41:21 -0500 (Wed, 18 Nov 2009)
New Revision: 18735
Added:
trunk/as/docs/reference/en/images/perspective/userlibraryfileset1.png
trunk/as/docs/reference/en/images/perspective/userlibraryfileset2.png
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-936 User Libraries fileset in project archive menu is described
Added: trunk/as/docs/reference/en/images/perspective/userlibraryfileset1.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/reference/en/images/perspective/userlibraryfileset1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/docs/reference/en/images/perspective/userlibraryfileset2.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/reference/en/images/perspective/userlibraryfileset2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2009-11-18 14:39:11 UTC (rev 18734)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2009-11-18 14:41:21 UTC (rev 18735)
@@ -1066,6 +1066,35 @@
</figure>
</section>
+
+ <section id="CreatingaUserLibrariesFileSet">
+ <title>Creating User Library FileSet</title>
+
+ <para>If you use user libraries in your projects you can also refer to these from project archives and have all the .jar/.zip files they refer included into the archive.</para>
+ <para>To add a new user libraries file set, call the right-click menu on the necessary archive and choose " New User Libraries FileSet" item</para>
+
+ <figure>
+ <title>Adding New User Library Fileset</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/perspective/userlibraryfileset1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can edit the existing user libraries as well using "User Libraries Fileset Wizard". Call the right-click menu on the library fileset and choose "Edit Fileset " item</para>
+
+ <figure>
+ <title>Editing User Library Fileset</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/perspective/userlibraryfileset2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
</section>
<section id="View_Actions">
15 years, 1 month
JBoss Tools SVN: r18734 - trunk/birt/docs/en/images/birt_integration_with_seam.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2009-11-18 09:39:11 -0500 (Wed, 18 Nov 2009)
New Revision: 18734
Added:
trunk/birt/docs/en/images/birt_integration_with_seam/helloBirtproject.png
Log:
Added: trunk/birt/docs/en/images/birt_integration_with_seam/helloBirtproject.png
===================================================================
(Binary files differ)
Property changes on: trunk/birt/docs/en/images/birt_integration_with_seam/helloBirtproject.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 1 month
JBoss Tools SVN: r18733 - in trunk/hibernatetools: plugins/org.hibernate.eclipse/src/org/hibernate/console and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-11-18 08:51:35 -0500 (Wed, 18 Nov 2009)
New Revision: 18733
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/ConsoleConfigUnloadJarChange.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/DeleteResourceParticipant.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/GarbageCollectionUtil.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-936 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2009-11-18 13:51:35 UTC (rev 18733)
@@ -484,6 +484,7 @@
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui.console,
org.eclipse.jface,
+ org.eclipse.jdt.apt.core,
org.eclipse.datatools.connectivity
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: registered
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-11-18 13:51:35 UTC (rev 18733)
@@ -30,12 +30,15 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -44,8 +47,11 @@
import org.dom4j.DocumentException;
import org.dom4j.Node;
import org.dom4j.io.DOMWriter;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.jdt.apt.core.internal.JarClassLoader;
import org.eclipse.osgi.util.NLS;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
@@ -71,9 +77,11 @@
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
+@SuppressWarnings("restriction")
public class ConsoleConfiguration implements ExecutionContextHolder {
private ExecutionContext executionContext;
+ private ClassLoader classLoader = null;
private Map<String, FakeDelegatingDriver> fakeDrivers = new HashMap<String, FakeDelegatingDriver>();
@@ -106,8 +114,20 @@
// reseting state
configuration = null;
closeSessionFactory();
+ cleanUpClassLoader();
}
+ public void cleanUpClassLoader() {
+ ClassLoader classLoaderTmp = classLoader;
+ while (classLoaderTmp != null) {
+ if (classLoaderTmp instanceof JarClassLoader) {
+ ((JarClassLoader)classLoaderTmp).close();
+ }
+ classLoaderTmp = classLoaderTmp.getParent();
+ }
+ classLoader = null;
+ }
+
public void build() {
configuration = buildWith(null, true);
fireConfigurationBuilt();
@@ -237,39 +257,102 @@
}
return customClassPathURLs;
}
+
+ public URL[] getCustomClassPathURLs_Jars() {
+ URL[] classPathURLs = getCustomClassPathURLs();
+ ArrayList<URL> res = new ArrayList<URL>();
+ for (int i = 0; i < classPathURLs.length; i++) {
+ String fileName = classPathURLs[i].getFile();
+ fileName = fileName.toLowerCase();
+ if (fileName.endsWith(".jar")) { //$NON-NLS-1$
+ res.add(classPathURLs[i]);
+ }
+ }
+ return res.toArray(new URL[0]);
+ }
+
+ protected URL[] getCustomClassPathURLs_NotJars() {
+ URL[] classPathURLs = getCustomClassPathURLs();
+ ArrayList<URL> res = new ArrayList<URL>();
+ for (int i = 0; i < classPathURLs.length; i++) {
+ String fileName = classPathURLs[i].getFile();
+ fileName = fileName.toLowerCase();
+ if (!fileName.endsWith(".jar")) { //$NON-NLS-1$
+ res.add(classPathURLs[i]);
+ }
+ }
+ return res.toArray(new URL[0]);
+ }
+
+ protected ClassLoader createJarClassLoader() {
+ URL[] customClassPathURLs_Jars = getCustomClassPathURLs_Jars();
+ List<File> filesTmp = new ArrayList<File>();
+ for (int i = 0; i < customClassPathURLs_Jars.length; i++) {
+ String filePath = customClassPathURLs_Jars[i].getPath();
+ IPath resourcePath = new Path(filePath);
+ File resourceFile = resourcePath.toFile();
+ //if (resourceFile.exists()) {
+ filesTmp.add(resourceFile);
+ //}
+ }
+ final List<File> files = filesTmp;
+ JarClassLoader jarClassLoader = AccessController.doPrivileged(new PrivilegedAction<JarClassLoader>() {
+ public JarClassLoader run() {
+ return new JarClassLoader(files, getParentClassLoader()) {
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException {
+ return null;
+ }
+ };
+ }
+ });
+ return jarClassLoader;
+ }
+
+ protected ClassLoader createURLClassLoader() {
+ final URL[] customClassPathURLs = getCustomClassPathURLs_NotJars();
+ URLClassLoader urlClassLoader = AccessController.doPrivileged(new PrivilegedAction<URLClassLoader>() {
+ public URLClassLoader run() {
+ return new URLClassLoader(customClassPathURLs, createJarClassLoader()) {
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ try {
+ return super.findClass(name);
+ } catch (ClassNotFoundException cnfe) {
+ throw cnfe;
+ }
+ }
+
+ protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ try {
+ return super.loadClass(name, resolve);
+ } catch (ClassNotFoundException cnfe) {
+ throw cnfe;
+ }
+ }
+
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
+ try {
+ return super.loadClass(name);
+ } catch (ClassNotFoundException cnfe) {
+ throw cnfe;
+ }
+ }
+ };
+ }
+ });
+ return urlClassLoader;
+ }
/**
* @return
*
*/
public Configuration buildWith(final Configuration cfg, final boolean includeMappings) {
- URL[] customClassPathURLs = getCustomClassPathURLs();
- executionContext = new DefaultExecutionContext( getName(), new URLClassLoader( customClassPathURLs, getParentClassLoader() ) {
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- try {
- return super.findClass( name );
- } catch(ClassNotFoundException cnfe) {
- throw cnfe;
- }
- }
+ if (classLoader == null) {
+ classLoader = createURLClassLoader();
+ }
+ executionContext = new DefaultExecutionContext(getName(), classLoader);
- protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
- try {
- return super.loadClass( name, resolve );
- } catch(ClassNotFoundException cnfe) {
- throw cnfe;
- }
- }
-
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- try {
- return super.loadClass( name );
- } catch(ClassNotFoundException cnfe) {
- throw cnfe;
- }
- }
- });
-
Configuration result = (Configuration) executionContext.execute(new ExecutionContext.Command() {
public Object execute() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2009-11-18 13:51:35 UTC (rev 18733)
@@ -21,7 +21,6 @@
*/
package org.hibernate.console.execution;
-import java.net.URLClassLoader;
import java.util.Map;
import java.util.WeakHashMap;
@@ -31,13 +30,13 @@
public class DefaultExecutionContext implements ExecutionContext {
- final private URLClassLoader configurationClassLoader;
+ final private ClassLoader configurationClassLoader;
private volatile int installs;
private Map<Thread, ClassLoader> previousLoaders = new WeakHashMap<Thread, ClassLoader>();
final String key;
- public DefaultExecutionContext(String key, URLClassLoader loader) {
+ public DefaultExecutionContext(String key, ClassLoader loader) {
configurationClassLoader = loader;
this.key = key;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2009-11-18 13:51:35 UTC (rev 18733)
@@ -640,6 +640,19 @@
label="hql editor colors coloring highlighting query"/>
</extension>
<extension
+ point="org.eclipse.ltk.core.refactoring.deleteParticipants">
+ <deleteParticipant
+ class="org.hibernate.eclipse.launch.core.refactoring.DeleteResourceParticipant"
+ id="org.hibernate.eclipse.launch.core.refactoring.DeleteResourceParticipant"
+ name="Console Configuration Resource Delete Participant">
+ <enablement>
+ <with variable="element">
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </with>
+ </enablement>
+ </deleteParticipant>
+ </extension>
+ <extension
point="org.eclipse.ltk.core.refactoring.renameParticipants">
<renameParticipant
class="org.hibernate.eclipse.launch.core.refactoring.ConsoleConfigurationITypeRenameParticipant"
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-11-18 13:51:35 UTC (rev 18733)
@@ -475,6 +475,7 @@
public static String LaunchConfigurationResourceNameChange_update_resource_path_in_launch_cfg;
public static String MoveResourceParticipant_launch_configurations_updates;
public static String RenameResourceParticipant_launch_configurations_updates;
+ public static String DeleteResourceParticipant_hibernate_configurations_updates;
public static String ConsoleConfigurationITypeRenameParticipant_update;
public static String ConsoleConfigurationITypeRenameParticipant_update_names;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-11-18 13:51:35 UTC (rev 18733)
@@ -482,6 +482,7 @@
LaunchConfigurationResourceNameChange_update_resource_path_in_launch_cfg=Update resource path in launch configuration
MoveResourceParticipant_launch_configurations_updates=Launch Configurations updates
RenameResourceParticipant_launch_configurations_updates=Launch Configurations updates
+DeleteResourceParticipant_hibernate_configurations_updates=Hibernate Configurations updates
DeleteProjectParticipant_console_configurations_updates=Delete related Console Configurations
DeleteProjectParticipant_delete_console_configuration=Delete Console Configuration ''{0}''
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/ConsoleConfigUnloadJarChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/ConsoleConfigUnloadJarChange.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/ConsoleConfigUnloadJarChange.java 2009-11-18 13:51:35 UTC (rev 18733)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.launch.core.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.hibernate.console.ConsoleConfiguration;
+
+/**
+ * @author Vitali Yemialyanchyk
+ */
+public class ConsoleConfigUnloadJarChange extends Change {
+
+ protected ConsoleConfiguration config;
+
+ public ConsoleConfigUnloadJarChange(ConsoleConfiguration config) {
+ this.config = config;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
+ */
+ @Override
+ public Object getModifiedElement() {
+ return config;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#getName()
+ */
+ @Override
+ public String getName() {
+ return config.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void initializeValidationData(IProgressMonitor pm) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ config.cleanUpClassLoader();
+ return null;
+ }
+
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/DeleteResourceParticipant.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/DeleteResourceParticipant.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/DeleteResourceParticipant.java 2009-11-18 13:51:35 UTC (rev 18733)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.launch.core.refactoring;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.DeleteParticipant;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
+
+/**
+ * @author Vitali Yemialyanchyk
+ */
+public class DeleteResourceParticipant extends DeleteParticipant {
+
+ private String path2Del = null;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+ */
+ @Override
+ public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
+ throws OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ @Override
+ public Change createPreChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ if (path2Del == null) {
+ return null;
+ }
+ List<Change> changes = new ArrayList<Change>();
+ ConsoleConfiguration[] configs = KnownConfigurations.getInstance().getConfigurations();
+ for (int i = 0; i < configs.length; i++) {
+ final ConsoleConfiguration config = configs[i];
+ final URL[] classPathURLs_Jars = config.getCustomClassPathURLs_Jars();
+ for (int j = 0; j < classPathURLs_Jars.length; j++) {
+ String path2Jar = classPathURLs_Jars[i].getPath();
+ if (path2Jar.startsWith(path2Del)) {
+ changes.add(new ConsoleConfigUnloadJarChange(config));
+ break;
+ }
+ }
+ }
+ return HibernateRefactoringUtil.createChangesFromList(changes, getName());
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
+ */
+ @Override
+ public String getName() {
+ return HibernateConsoleMessages.DeleteResourceParticipant_hibernate_configurations_updates;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
+ */
+ @Override
+ protected boolean initialize(Object element) {
+ boolean res = false;
+ IResource res2Del = (IResource)element;
+ String path2Del = res2Del.getLocationURI().getPath();
+ ConsoleConfiguration[] configs = KnownConfigurations.getInstance().getConfigurations();
+ for (int i = 0; i < configs.length; i++) {
+ final ConsoleConfiguration config = configs[i];
+ final URL[] classPathURLs_Jars = config.getCustomClassPathURLs_Jars();
+ for (int j = 0; j < classPathURLs_Jars.length; j++) {
+ String path2Jar = classPathURLs_Jars[i].getPath();
+ if (path2Jar.startsWith(path2Del)) {
+ res = true;
+ }
+ }
+ }
+ this.path2Del = res ? path2Del : null;
+ return res;
+ }
+
+}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2009-11-18 13:51:35 UTC (rev 18733)
@@ -53,6 +53,7 @@
org.eclipse.ui.views,
org.jboss.tools.hibernate.ui,
org.jboss.tools.tests,
+ org.eclipse.jdt.apt.core,
org.eclipse.debug.ui,
org.eclipse.ui.workbench.texteditor;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/GarbageCollectionUtil.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/GarbageCollectionUtil.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/GarbageCollectionUtil.java 2009-11-18 13:51:35 UTC (rev 18733)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.test.utils;
+
+/**
+ * @author Vitali Yemialyanchyk
+ */
+public class GarbageCollectionUtil {
+
+ static public int forceCollectGarbage() {
+ int numGCCall = 0;
+ long freeMemory = 0;
+ long freeMemoryAfter = freeMemory;
+ do {
+ freeMemory = Runtime.getRuntime().freeMemory();
+ System.gc();
+ numGCCall++;
+ freeMemoryAfter = Runtime.getRuntime().freeMemory();
+ } while (freeMemoryAfter - freeMemory != 0);
+ return numGCCall;
+ }
+
+}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2009-11-18 12:21:32 UTC (rev 18732)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2009-11-18 13:51:35 UTC (rev 18733)
@@ -14,6 +14,7 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.lang.ref.WeakReference;
@@ -25,14 +26,19 @@
import java.security.PrivilegedAction;
import java.sql.DriverManager;
import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
import java.util.Vector;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.apt.core.internal.JarClassLoader;
import org.hibernate.console.execution.DefaultExecutionContext;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
+import org.hibernate.eclipse.console.test.utils.GarbageCollectionUtil;
import org.hibernate.util.ReflectHelper;
import junit.framework.TestCase;
@@ -44,6 +50,7 @@
*
* @author Vitali Yemialyanchyk
*/
+@SuppressWarnings("restriction")
public class DriverDeleteTest extends TestCase {
public static final String DRIVER_TEST_NAME = "mysql-connector-java-5.0.7-bin.jar"; //$NON-NLS-1$
@@ -69,6 +76,18 @@
return customClassPathURLs;
}
+ protected List<File> getCustomClassPathFiles() {
+ final List<File> files = new ArrayList<File>();
+ File driverJar2;
+ try {
+ driverJar2 = getResourceItem(DRIVER_PUT_PATH);
+ files.add(driverJar2);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return files;
+ }
+
protected File getResourceItem(String strResPath) throws IOException {
IPath resourcePath = new Path(strResPath);
File resourceFolder = resourcePath.toFile();
@@ -124,28 +143,49 @@
URLClassLoader urlClassLoader = AccessController.doPrivileged(new PrivilegedAction<URLClassLoader>() {
public URLClassLoader run() {
return new URLClassLoader( customClassPathURLs, getParentClassLoader() ) {
- protected Class<?> findClass(String name) throws ClassNotFoundException {
+ public InputStream getResourceAsStream(String name) {
+ InputStream is = super.getResourceAsStream(name);
+ return is;
+ }
+
+ public URL findResource(final String name) {
+ URL res = super.findResource(name);
+ return res;
+ }
+
+ public Enumeration<URL> findResources(final String name) throws IOException {
+ Enumeration<URL> res = super.findResources(name);
+ return res;
+ }
+
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ Class<?> res = null;
try {
- return super.findClass(name);
+ res = super.findClass(name);
} catch (ClassNotFoundException cnfe) {
throw cnfe;
}
+ return res;
}
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ Class<?> res = null;
try {
- return super.loadClass(name, resolve);
+ res = super.loadClass(name, resolve);
} catch (ClassNotFoundException cnfe) {
throw cnfe;
}
+ return res;
}
public Class<?> loadClass(String name) throws ClassNotFoundException {
+ Class<?> res = null;
try {
- return super.loadClass(name);
+ res = super.loadClass(name);
} catch (ClassNotFoundException cnfe) {
throw cnfe;
}
+ return res;
}
};
}
@@ -153,6 +193,17 @@
return urlClassLoader;
}
+ public JarClassLoader createJarClassLoader() {
+ final List<File> files = getCustomClassPathFiles();
+ JarClassLoader urlClassLoader = AccessController.doPrivileged(new PrivilegedAction<JarClassLoader>() {
+ public JarClassLoader run() {
+ return new JarClassLoader(files, getParentClassLoader()) {
+ };
+ }
+ });
+ return urlClassLoader;
+ }
+
public class StringWriter extends Writer {
public String res = new String();
@@ -170,11 +221,36 @@
res += cbuf.toString() + "\r\n"; //$NON-NLS-1$
}
}
+
+ @SuppressWarnings("unchecked")
+ public void forceDeleteDrivers() {
+ Class<DriverManager> clazz = DriverManager.class;
+ Vector drivers = null;
+ try {
+ Field field = clazz.getDeclaredField("drivers"); //$NON-NLS-1$
+ field.setAccessible(true);
+ drivers = (Vector)field.get(null);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ }
+ if (drivers != null && drivers.size() > 0) {
+ drivers.clear();
+ }
+ clazz = null;
+ drivers = null;
+ }
@SuppressWarnings("unchecked")
public void initExecutionContext() {
/**/
- URLClassLoader urlClassLoader = createClassLoader();
+ //URLClassLoader urlClassLoader = createClassLoader();
+ JarClassLoader urlClassLoader = createJarClassLoader();
/**/
Class<Driver> driverClass = null;
try {
@@ -192,7 +268,6 @@
/**/
try {
driver = driverClass.newInstance();
- /**/
DriverManager.registerDriver(driver);
//DriverManager.deregisterDriver(driver);
java.util.Enumeration<Driver> drEnum = DriverManager.getDrivers();
@@ -201,7 +276,6 @@
DriverManager.deregisterDriver(driver);
numRedDrivers++;
}
- /**/
} catch (SQLException e) {
e.printStackTrace();
} catch (InstantiationException e) {
@@ -210,79 +284,55 @@
e.printStackTrace();
}
/**/
- Class<DriverManager> clazz = DriverManager.class;
- Vector drivers = null;
- try {
- Field field = clazz.getDeclaredField("drivers"); //$NON-NLS-1$
- field.setAccessible(true);
- drivers = (Vector)field.get(null);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
- e.printStackTrace();
- }
- if (drivers != null && drivers.size() > 0) {
- drivers.clear();
- }
System.out.print(wr.res);
/** /
DefaultExecutionContext dec = new DefaultExecutionContext(getName(), urlClassLoader);
executionContext = new WeakReference<ExecutionContext>(dec);
- dec = null;
/** /
- dec.execute(new ExecutionContext.Command() {
-
- @SuppressWarnings("unchecked")
+ ExecutionContext.Command command = new ExecutionContext.Command() {
public Object execute() {
try {
Class<Driver> driverClass = null;
//if (driverClass != null) {
- driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
+ //driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ if (contextClassLoader != null) {
+ driverClass = (Class<Driver>)contextClassLoader.loadClass("com.mysql.jdbc.Driver"); //$NON-NLS-1$
+ }
//if (driverClass == null) {
- DriverManager.registerDriver(driverClass.newInstance());
+ //driverClass.newInstance();
+ //DriverManager.registerDriver(driverClass.newInstance());
//}
//}
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
+ //contextClassLoader = null;
+ //driverClass = null;
+ //} catch (InstantiationException e) {
+ // e.printStackTrace();
+ //} catch (IllegalAccessException e) {
+ // e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
- } catch (SQLException e) {
- e.printStackTrace();
+ //} catch (SQLException e) {
+ // e.printStackTrace();
}
return null;
}
- });
- /**/
+ };
+ dec.execute(command);
+ command = null;
+ dec = null;
+ /** /
+ forceDeleteDrivers();
//
- clazz = null;
- drivers = null;
// obligatory in other case gc can't collect these variables!!!
driver = null;
driverClass = null;
urlClassLoader = null;
forceCollectGarbage();
/**/
+ urlClassLoader.close();
}
- public int forceCollectGarbage() {
- int numGCCall = 0;
- long freeMemory = 0;
- long freeMemoryAfter = freeMemory;
- do {
- freeMemory = Runtime.getRuntime().freeMemory();
- System.gc();
- numGCCall++;
- freeMemoryAfter = Runtime.getRuntime().freeMemory();
- } while (freeMemoryAfter - freeMemory != 0);
- return numGCCall;
- }
-
public void cleanupExecutionContext() {
if (executionContext != null && executionContext.get() != null) {
executionContext.get().execute(new ExecutionContext.Command() {
@@ -307,7 +357,7 @@
executionContext = null;
}
//
- forceCollectGarbage();
+ GarbageCollectionUtil.forceCollectGarbage();
}
public void testDelete() {
15 years, 1 month
JBoss Tools SVN: r18732 - trunk/documentation/qa/docs/Test_Cases.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2009-11-18 07:21:32 -0500 (Wed, 18 Nov 2009)
New Revision: 18732
Modified:
trunk/documentation/qa/docs/Test_Cases/SmokeTests.doc
Log:
Removed forgotten comments.
Modified: trunk/documentation/qa/docs/Test_Cases/SmokeTests.doc
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Tools SVN: r18731 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-11-18 06:59:49 -0500 (Wed, 18 Nov 2009)
New Revision: 18731
Modified:
trunk/seam/docs/reference/en/modules/generate_entities.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-912 - updating the 'Seam Generate Entities' chapter, adding the note about console configuration;
Modified: trunk/seam/docs/reference/en/modules/generate_entities.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/generate_entities.xml 2009-11-18 11:58:13 UTC (rev 18730)
+++ trunk/seam/docs/reference/en/modules/generate_entities.xml 2009-11-18 11:59:49 UTC (rev 18731)
@@ -12,8 +12,8 @@
<title>Seam Generate Entities</title>
<para>The main purpose of this chapter is to tell you about Seam Generate Entities.</para>
- <para>Generate Entities is available directly from within Eclipse using Hibernate Tools plugin for the standard seam-gen generation.</para>
- <para>Generate Entities generates a set of CRUD Seam components and web pages based on existing tables in a database or on existing entities in your application.</para>
+ <para>Generate Entities is available directly from Eclipse using Hibernate Tools plugin for the standard seam-gen generation.</para>
+ <para>The wizard generates a set of CRUD Seam components and web pages based on existing tables in a database or on existing entities in your application.</para>
<figure>
@@ -25,26 +25,32 @@
</mediaobject>
</figure>
- <para>In the Generate Seam Entities wizard there are two generation modes: Reverse Engineer from database
- and Use existing entities.</para>
-
- <para>The <property>Reverse Engineer from database</property> mode can be described in four steps:</para>
+ <para>By default, the generation mode is set to <emphasis><property>Reverse engineer from database</property>.</emphasis>
+ The reverse engineering from a database could be described in four steps:</para>
<orderedlist>
<listitem><para>The wizard gets in database, extracts the tables and
their connections</para></listitem>
<listitem><para>On basis of this metainfomation the Entity classes are generated into
- <property>org.domain.project.entity</property> package</para></listitem>
+ <literal>org.domain.project.entity</literal> package</para></listitem>
<listitem><para>For the entities from step 2 the classes <property>EntityList</property> and <property>EntityHome</property> are generated
- into <property>org.domain.project.session</property> package</para></listitem>
+ into <literal>org.domain.project.session</literal> package</para></listitem>
<listitem><para>The xhtml pages are generated.</para></listitem>
</orderedlist>
+
+ <note>
+ <title>Note:</title>
+ <para>The entities are generated from a database based on the console configuration that is created automatically during a Seam project creation.
+ (Read more about <ulink url="&hibernatelink;#console_conf">console configuration</ulink>). The created console configuration is based on the
+ connection profile set on the <link linkend="seamFacet">Seam Facets wizard page</link> while creating a project.
+ Configured connection profile settings are hold in the generated <literal>hibernate-console.properties</literal>. To change the connection
+ profile, double-click the console configuration. It could be found in the <property>Hibernate Configurations</property> view
+ (<emphasis><property>Window > Show view > Other > Hibernate > Hibernate Configurations</property></emphasis>
+ or just switch to the <property>Hibernate</property> perspective).</para>
+ </note>
<para>
- Checking the <property>Use existing entities</property> mode the wizard executes only 3 and 4 steps. It generates missing classes and
+ Checking the <emphasis><property>Use existing entities</property></emphasis> mode the wizard executes only 3 and 4 steps. It generates missing classes and
xhtml pages.
</para>
<para>Read the <link linkend="crud_database_application">Generate a CRUD Database Application</link> chapter in order to see how the <property>Generate Seam Entities</property> wizard can be used.</para>
-
-
- </chapter>
-
+ </chapter>
\ No newline at end of file
15 years, 1 month
JBoss Tools SVN: r18730 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-11-18 06:58:13 -0500 (Wed, 18 Nov 2009)
New Revision: 18730
Modified:
trunk/seam/docs/reference/en/modules/seam_preferences.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-912 - minor changes in 'Project Preferences' section;
Modified: trunk/seam/docs/reference/en/modules/seam_preferences.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_preferences.xml 2009-11-18 11:56:44 UTC (rev 18729)
+++ trunk/seam/docs/reference/en/modules/seam_preferences.xml 2009-11-18 11:58:13 UTC (rev 18730)
@@ -181,7 +181,7 @@
<tip>
<title>Tip:</title>
- <para>On the figure above fields for configuring Seam artifacts are dimmed because Seam
+ <para>On the figure above fields for configuring Seam artifacts are unavailable because Seam
Runtime is not selected.</para>
</tip>
15 years, 1 month
JBoss Tools SVN: r18729 - trunk/seam/docs/reference/en/images/seam_preferences.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-11-18 06:56:44 -0500 (Wed, 18 Nov 2009)
New Revision: 18729
Modified:
trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2.png
trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2_2.png
Log:
https://jira.jboss.org/jira/browse/JBDS-912 - Connection profile is removed from seam settings page: updating the screenshot;
Modified: trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2_2.png
===================================================================
(Binary files differ)
15 years, 1 month