JBoss Tools SVN: r4285 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-10-17 08:02:50 -0400 (Wed, 17 Oct 2007)
New Revision: 4285
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java
Log:
Visibility of constructor changed to public.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java 2007-10-17 10:56:01 UTC (rev 4284)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java 2007-10-17 12:02:50 UTC (rev 4285)
@@ -42,7 +42,7 @@
/** if true then only return the classname, not the fully qualified classname */
final boolean dequalify;
- TypeNameValueVisitor(boolean dequalify) {
+ public TypeNameValueVisitor(boolean dequalify) {
this.dequalify=dequalify;
}
17 years, 2 months
JBoss Tools SVN: r4284 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-10-17 06:56:01 -0400 (Wed, 17 Oct 2007)
New Revision: 4284
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1086
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2007-10-17 10:20:55 UTC (rev 4283)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2007-10-17 10:56:01 UTC (rev 4284)
@@ -95,6 +95,14 @@
/** LOG_DATE_FORMAT */
final private static SimpleDateFormat LOG_DATE_FORMAT = new SimpleDateFormat(
"yyyyMMddHHmmss");
+
+ final private static SimpleDateFormat CURENT_DATE_FORMAT = new SimpleDateFormat(
+ "yyyy-MM-dd");
+
+ final private static SimpleDateFormat SESSION_DATE_FORMAT = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm");
+
+ final private static long TWENTY_FOUR_HOURS = 86400000;
/** log file name */
private Text logFileName;
@@ -243,9 +251,45 @@
ModelUIPlugin.getPluginLog().logError(e);
}
- return sb.toString().getBytes();
+ return getLogByCurentDate(sb.toString()).getBytes();
};
+
+ private String getLogByCurentDate(String log){
+ String lastOldSession="";
+ boolean isAccept = false;
+ Date today = new Date();
+ StringBuffer sb = new StringBuffer();
+ StringTokenizer st = new StringTokenizer(log, "\n", true);
+ while (st.hasMoreTokens()) {
+ String t = st.nextToken();
+ if(t.startsWith("!SESSION")){
+ String dateString = t.substring(9, 25);
+ try{
+ Date date = SESSION_DATE_FORMAT.parse(dateString);
+ long delta = today.getTime()-date.getTime();
+ if(delta < TWENTY_FOUR_HOURS){
+ if(!isAccept) sb.append(lastOldSession+"\n");
+ sb.append(t);
+ isAccept = true;
+ }else{
+ lastOldSession = new String(t);
+ isAccept = false;
+ }
+ }catch(Exception ex){
+ //ModelUIPlugin.getPluginLog().logError(ex);
+ sb.append(t);
+ isAccept = true;
+ }
+ }else{
+ if(isAccept){
+ sb.append(t);
+ }
+ }
+ }
+ return sb.toString();
+ }
+
/**
* @return
*/
17 years, 2 months
JBoss Tools SVN: r4283 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-17 06:20:55 -0400 (Wed, 17 Oct 2007)
New Revision: 4283
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java
Log:
JBIDE-1102
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java 2007-10-17 09:33:36 UTC (rev 4282)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java 2007-10-17 10:20:55 UTC (rev 4283)
@@ -22,6 +22,8 @@
Element element = XMLUtil.getElement(new StringReader(body));
if(element == null) return;
if(!"project".equals(element.getNodeName())) return;
+ if(element.getAttributeNode("xmlns") != null) return;
+ if(element.getAttributeNode("xsi:schemaLocation") != null) return;
NodeList es = element.getElementsByTagName("target");
for (int i = 0; i < es.getLength(); i++)
if(!((Element)es.item(i)).hasAttribute("name")) return;
17 years, 2 months
JBoss Tools SVN: r4282 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-10-17 05:33:36 -0400 (Wed, 17 Oct 2007)
New Revision: 4282
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessorFactory.java
Log:
removed unused hql annotation processors to avoid stupid access restriction error in eclipse.
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessor.java 2007-10-17 08:48:47 UTC (rev 4281)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessor.java 2007-10-17 09:33:36 UTC (rev 4282)
@@ -1,197 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.eclipse.jdt.apt.ui;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jdt.apt.core.env.EclipseAnnotationProcessorEnvironment;
-import org.eclipse.jdt.apt.core.env.Phase;
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.eclipse.nature.HibernateNature;
-import org.hibernate.engine.query.HQLQueryPlan;
-import org.hibernate.impl.SessionFactoryImpl;
-
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.Messager;
-import com.sun.mirror.declaration.AnnotationMirror;
-import com.sun.mirror.declaration.AnnotationTypeDeclaration;
-import com.sun.mirror.declaration.AnnotationTypeElementDeclaration;
-import com.sun.mirror.declaration.AnnotationValue;
-import com.sun.mirror.declaration.Declaration;
-import com.sun.mirror.type.AnnotationType;
-
-public class HQLAnnotationProcessor implements AnnotationProcessor
-{
- final EclipseAnnotationProcessorEnvironment env;
-
- public HQLAnnotationProcessor(AnnotationProcessorEnvironment env)
- {
- if(env instanceof EclipseAnnotationProcessorEnvironment) {
- this.env = (EclipseAnnotationProcessorEnvironment) env;
- } else {
- this.env = null;
- }
- }
-
- static ConsoleConfiguration getConsoleConfiguration(HibernateNature hibernateNature) {
-
- if(hibernateNature!=null) {
- return hibernateNature.getDefaultConsoleConfiguration();
- } else {
- return null;
- }
- }
-
- private ConsoleConfiguration getConsoleConfiguration() {
- return getConsoleConfiguration(HibernateNature.getHibernateNature( env.getJavaProject() ));
- }
-
-
- public void process()
- {
- try {
- if(env==null) {
- return; // quick stop if not running inside eclipse.
- }
-
- if(env.getPhase()==Phase.RECONCILE) {
- return; // quick stop if user "editing"
- }
-
- ConsoleConfiguration cc = getConsoleConfiguration();
-
- Messager messager = env.getMessager();
-
- Set types = new HashSet();
- AnnotationTypeDeclaration jpa_queries = (AnnotationTypeDeclaration)this.env.getTypeDeclaration("javax.persistence.NamedQueries");
- types.addAll(env.getDeclarationsAnnotatedWith(jpa_queries));
-
- AnnotationTypeDeclaration hibernate_queries = (AnnotationTypeDeclaration)this.env.getTypeDeclaration("org.hibernate.annotations.NamedQueries");
- types.addAll( env.getDeclarationsAnnotatedWith(hibernate_queries) );
-
- AnnotationTypeDeclaration jpa_namedQuery = (AnnotationTypeDeclaration)this.env.getTypeDeclaration("javax.persistence.NamedQuery");
- types.addAll( env.getDeclarationsAnnotatedWith(jpa_namedQuery) );
-
- AnnotationTypeDeclaration hibernate_namedQuery = (AnnotationTypeDeclaration)this.env.getTypeDeclaration("org.hibernate.annotations.NamedQuery");
- types.addAll( env.getDeclarationsAnnotatedWith(hibernate_namedQuery) );
-
- handleNamedQueryTypes( cc, messager, types );
- } catch (NullPointerException npe) {
- env.getMessager().printError( npe.toString() );
- npe.printStackTrace();
- }
-
- }
-
- private void handleNamedQueryTypes(ConsoleConfiguration cc, Messager messager, Collection annotatedTypes) {
- for (Iterator iter = annotatedTypes.iterator(); iter.hasNext();) {
- Declaration decl = (Declaration) iter.next();
-
- Collection mirrors = decl.getAnnotationMirrors();
-
- for (Iterator iterator = mirrors.iterator(); iterator.hasNext();) {
- AnnotationMirror mirror = (AnnotationMirror) iterator.next();
- AnnotationType annotationType = mirror.getAnnotationType();
- String simpleName = annotationType.getDeclaration().getSimpleName();
- if(simpleName.equals( "NamedQueries" )) {
- Map valueMap = mirror.getElementValues();
- Set valueSet = valueMap.entrySet();
-
- for (Iterator it3 = valueSet.iterator(); it3.hasNext();) {
- Map.Entry annoKeyValue = (Map.Entry) it3.next();
-
- AnnotationValue annoValue = (AnnotationValue) annoKeyValue.getValue();
-
- AnnotationTypeElementDeclaration atedec = (AnnotationTypeElementDeclaration) annoKeyValue.getKey();
- if (atedec.getSimpleName().equals("value")) {
- Object queryValueList = annoValue.getValue();
- if (queryValueList instanceof Collection) {
- Collection values = (Collection) queryValueList;
- for (Iterator val = values.iterator(); val.hasNext();) {
- Object element = val.next();
- if(element instanceof AnnotationValue) {
- AnnotationValue el = (AnnotationValue) element;
- if(el.getValue() instanceof AnnotationMirror) {
- AnnotationMirror annMirror = (AnnotationMirror) el.getValue();
-
- handleNamedQuery( cc, messager, annMirror );
-
- }
- }
- }
-
- }
- }
- }
- } else if (simpleName.equals("NamedQuery")) {
- handleNamedQuery( cc, messager, mirror );
- }
-
- }
- }
- }
-
- private void handleNamedQuery(ConsoleConfiguration cc, Messager messager, AnnotationMirror mirror) {
- Map valueMap = mirror.getElementValues();
- Set valueSet = valueMap.entrySet();
-
- for (Iterator it3 = valueSet.iterator(); it3.hasNext();) {
- Map.Entry annoKeyValue = (Map.Entry) it3.next();
-
- AnnotationValue annoValue = (AnnotationValue) annoKeyValue.getValue();
-
- AnnotationTypeElementDeclaration atedec = (AnnotationTypeElementDeclaration) annoKeyValue.getKey();
- handleSingleQuery( cc, messager, annoValue, atedec );
- }
- }
-
- private void handleSingleQuery(ConsoleConfiguration cc, Messager messager, AnnotationValue annoValue, AnnotationTypeElementDeclaration atedec) {
- if (atedec.getSimpleName().equals("query")) {
- Object query = annoValue.getValue();
- if (query instanceof String) {
- checkQuery( cc, messager, annoValue, query );
- }
- }
- }
-
- private void checkQuery(ConsoleConfiguration cc, Messager messager, AnnotationValue annoValue, Object query) {
- try {
- if(cc!=null && cc.isSessionFactoryCreated()) {
- new HQLQueryPlan((String)query, false, Collections.EMPTY_MAP, (SessionFactoryImpl)cc.getSessionFactory());
- } else {
- messager.printWarning( annoValue.getPosition(), "Could not verify syntax. SessionFactory not created." );
- }
- } catch(RuntimeException re) {
- messager.printError(annoValue.getPosition(), re.getMessage());
- }
- }
-
-
-
-
-}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessorFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessorFactory.java 2007-10-17 08:48:47 UTC (rev 4281)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.apt.ui/src/org/hibernate/eclipse/jdt/apt/ui/HQLAnnotationProcessorFactory.java 2007-10-17 09:33:36 UTC (rev 4282)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.eclipse.jdt.apt.ui;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jdt.apt.core.env.EclipseAnnotationProcessorEnvironment;
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.eclipse.nature.HibernateNature;
-
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.AnnotationProcessorFactory;
-
-public class HQLAnnotationProcessorFactory implements AnnotationProcessorFactory
-{
-
- public HQLAnnotationProcessorFactory() {
-
- }
-
- public Collection supportedOptions() {
- return Collections.EMPTY_LIST;
- }
-
- public Collection supportedAnnotationTypes() {
- return annotations;
- }
-
- public AnnotationProcessor getProcessorFor(
- Set atds,
- AnnotationProcessorEnvironment env)
- {
- if(env instanceof EclipseAnnotationProcessorEnvironment) {
- EclipseAnnotationProcessorEnvironment eenv = (EclipseAnnotationProcessorEnvironment) env;
- if(canProcess( eenv )) {
- return new HQLAnnotationProcessor(eenv);
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-
- private boolean canProcess(EclipseAnnotationProcessorEnvironment eenv) {
- HibernateNature hibernateNature = HibernateNature.getHibernateNature( eenv.getJavaProject() );
- if(hibernateNature==null) {
- eenv.getMessager().printWarning( "Cannot process HQL queries. Hibernate not enabled for project [" + eenv.getJavaProject().getProject().getName() + "]" );
- return false;
- }
-
- ConsoleConfiguration cc = HQLAnnotationProcessor.getConsoleConfiguration( hibernateNature );
- if(cc==null) {
- eenv.getMessager().printWarning( "Cannot process HQL queries. No console configuration found for project [" + eenv.getJavaProject().getProject().getName() + "]" );
- return false;
- }
-
- if(!cc.isSessionFactoryCreated()) {
- eenv.getMessager().printWarning( "Cannot process HQL queries. No session factory created for console configuration [" + cc.getName() + "]" );
- return false;
- }
-
- return true;
- }
-
- private static List annotations = new ArrayList();
-
- static {
- annotations.add( "javax.persistence.NamedQuery" );
- annotations.add( "javax.persistence.NamedQueries" );
- annotations.add( "org.hibernate.annotations.NamedQuery" );
- annotations.add( "org.hibernate.annotations.NamedQueries" );
- }
-}
-
17 years, 2 months
JBoss Tools SVN: r4281 - trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2007-10-17 04:48:47 -0400 (Wed, 17 Oct 2007)
New Revision: 4281
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.cvsignore
Log:
Unnecessary .cvsignore files were deleted
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.cvsignore
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.cvsignore 2007-10-17 08:48:42 UTC (rev 4280)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.cvsignore 2007-10-17 08:48:47 UTC (rev 4281)
@@ -1 +0,0 @@
-bin
17 years, 2 months
JBoss Tools SVN: r4280 - trunk/vpe/plugins/org.jboss.tools.vpe.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2007-10-17 04:48:42 -0400 (Wed, 17 Oct 2007)
New Revision: 4280
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/.cvsignore
Log:
Unnecessary .cvsignore files were deleted
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/.cvsignore
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/.cvsignore 2007-10-17 02:11:16 UTC (rev 4279)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/.cvsignore 2007-10-17 08:48:42 UTC (rev 4280)
@@ -1 +0,0 @@
-bin
17 years, 2 months
JBoss Tools SVN: r4279 - trunk/tests/features/org.jboss.tools.test.feature.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-10-16 22:11:16 -0400 (Tue, 16 Oct 2007)
New Revision: 4279
Modified:
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
Log:
removed org.jboss.tools.vpe.mozilla.test, waiting for xulrunner tests
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2007-10-17 01:52:42 UTC (rev 4278)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2007-10-17 02:11:16 UTC (rev 4279)
@@ -272,12 +272,6 @@
version="0.0.0"/>
<plugin
- id="org.jboss.tools.vpe.mozilla.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.vpe.test"
download-size="0"
install-size="0"
17 years, 3 months
JBoss Tools SVN: r4278 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: extensions/archives and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-10-16 21:52:42 -0400 (Tue, 16 Oct 2007)
New Revision: 4278
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
Log:
JBIDE-1048
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -90,17 +90,6 @@
return plugin;
}
-
- public static String getResourceString (String key) {
- try {
- String value = Platform.getResourceString(getDefault().getBundle(), key);
- return value;
- } catch (Exception e) {
- e.printStackTrace();
- return key;
- }
- }
-
/**
* Returns the plugin's resource bundle,
*/
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/EjbArchiveType.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -5,6 +5,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.server.core.IModule;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
@@ -44,7 +45,8 @@
IJavaProject proj = JavaCore.create(project);
IPath outputLoc = proj.getOutputLocation();
addFileset(project, topLevel, outputLoc.toOSString(), null);
- } catch( Exception e ) {
+ } catch( JavaModelException jmde) {
+ // ignore. No reporting necessary here
}
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/J2EEArchiveType.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -27,7 +27,9 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
@@ -40,6 +42,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
*
@@ -82,7 +85,6 @@
try {
sourcePath = javaProject.getOutputLocation();
} catch (JavaModelException e) {
- e.printStackTrace();
return null;
}
sourcePath = sourcePath.removeFirstSegments(1);
@@ -93,7 +95,7 @@
sourcePathContainer = project.getFolder(sourcePath);
return createGenericIArchive(project, deployDirectory, packageName, sourcePathContainer);
} catch( Exception e ) {
- e.printStackTrace();
+ JBossServerCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Unexpected Exception", e));
}
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/archives/WarArchiveType.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -27,7 +27,9 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
@@ -41,6 +43,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
*
@@ -111,6 +114,7 @@
outputLoc = outputLoc.append(jp.getOutputLocation());
addFileset(project, folder, jp.getOutputLocation().toOSString(), "**/*");
} catch( JavaModelException jme ) {
+ // no logging
}
}
}
@@ -165,7 +169,7 @@
}
}
} catch( JavaModelException jme ) {
- jme.printStackTrace();
+ // no logging
}
}
}
@@ -205,7 +209,7 @@
}
return topLevel;
} catch( Exception e ) {
- e.printStackTrace();
+ JBossServerCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Unexpected Exception", e));
}
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -1,32 +1,43 @@
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.dom4j.Document;
+import org.dom4j.DocumentException;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.xml.sax.SAXException;
/**
* Parses and potentially stores descriptor files.
*
* @author rstryker
- *
+ *
*/
public class XMLDocumentRepository {
private static XMLDocumentRepository instance = null;
+
public static XMLDocumentRepository getDefault() {
- if( instance == null )
+ if (instance == null)
instance = new XMLDocumentRepository();
return instance;
}
-
+
private HashMap pathToDocument;
private HashMap pathToTimestamp;
private XMLDocumentRepository parent;
@@ -45,52 +56,73 @@
public Document getDocument(String fullPath) {
return getDocument(fullPath, true);
}
-
+
public Document getDocument(String fullPath, boolean load) {
return getDocument(fullPath, load, true);
}
-
+
public Document getDocument(String fullPath, boolean load, boolean save) {
- Document d = (Document)pathToDocument.get(fullPath);
- if( d == null && load ) {
+ Document d = (Document) pathToDocument.get(fullPath);
+ if (d == null && load) {
d = loadDocument(fullPath);
- if( save ) {
+ if (save) {
pathToDocument.put(fullPath, d);
- pathToTimestamp.put(fullPath, new Long(new File(fullPath).lastModified()));
+ pathToTimestamp.put(fullPath, new Long(new File(fullPath)
+ .lastModified()));
}
}
return d;
}
-
+
public boolean refresh(String fullPath) {
- if( new File(fullPath).lastModified() != ((Long)pathToTimestamp.get(fullPath)).longValue()) {
+ if (new File(fullPath).lastModified() != ((Long) pathToTimestamp
+ .get(fullPath)).longValue()) {
pathToDocument.put(fullPath, loadDocument(fullPath));
- pathToTimestamp.put(fullPath, new Long(new File(fullPath).lastModified()));
+ pathToTimestamp.put(fullPath, new Long(new File(fullPath)
+ .lastModified()));
return true;
}
return false;
}
-
+
private Document loadDocument(String fullpath) {
+ Exception ex = null;
try {
- URL url = new File(fullpath).toURI().toURL();
+ URL url;
+ url = new File(fullpath).toURI().toURL();
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
- sp.getXMLReader().setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
-
+ sp
+ .getXMLReader()
+ .setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd",
+ false);
+
SAXReader reader = new SAXReader(false);
reader.setXMLReader(sp.getXMLReader());
Document document = reader.read(url);
-
+
return document;
- } catch( Exception e ) {
- e.printStackTrace();
+ } catch (MalformedURLException e) {
+ ex = e;
+ } catch (ParserConfigurationException e) {
+ ex = e;
+ } catch (SAXException e) {
+ ex = e;
+ } catch (DocumentException e) {
+ ex = e;
}
+ if (ex != null) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Could not load document: " + fullpath, ex));
+ }
return null;
}
public static void saveDocument(Document doc, String fullPath) {
+ Exception ex = null;
try {
File outFile = new File(fullPath);
FileOutputStream os = new FileOutputStream(outFile);
@@ -98,9 +130,19 @@
XMLWriter writer = new XMLWriter(os, outformat);
writer.write(doc);
writer.flush();
- } catch( Exception e ) {
- e.printStackTrace();
+ } catch (MalformedURLException e) {
+ ex = e;
+ } catch (FileNotFoundException e) {
+ ex = e;
+ } catch (UnsupportedEncodingException e) {
+ ex = e;
+ } catch (IOException e) {
+ ex = e;
}
-
+ if (ex != null) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Could not save document: " + fullPath, ex));
+ }
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -1,5 +1,7 @@
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
+import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
@@ -10,8 +12,10 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerLifecycleListener;
import org.eclipse.wst.server.core.ServerCore;
@@ -187,11 +191,9 @@
for( int i = 0; i < queriesByName.length; i++ ) {
queryAsStringValues = helper.getAttribute(QUERY + "." + queriesByName[i].replace(' ', '_'), (List)null);
if( queryAsStringValues != null ) {
- try {
- XPathQuery q =new XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1), queryAsStringValues);
- q.setCategory(category);
- returnList.add(q);
- } catch( Exception e ) {e.printStackTrace(); }
+ XPathQuery q =new XPathQuery(queriesByName[i].substring(queriesByName[i].indexOf(Path.SEPARATOR)+1), queryAsStringValues);
+ q.setCategory(category);
+ returnList.add(q);
}
}
return (XPathQuery[]) returnList.toArray(new XPathQuery[returnList.size()]);
@@ -239,11 +241,12 @@
}
}
retVal.add(ports);
- } catch( Exception e ) {
- e.printStackTrace();
+ } catch (IOException e) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Error loading default xpaths", e));
}
serverToCategories.put(server.getId(), retVal);
- //save(server);
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -7,8 +7,11 @@
import java.util.HashMap;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
* A repository for classloaders that relate to servers,
@@ -99,6 +102,9 @@
Thread.currentThread().getContextClassLoader());
idToLoader.put(s.getId(), loader);
} catch (MalformedURLException murle) {
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Cannot load JMX classes for server: " + s.getName(), murle));
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -21,7 +21,10 @@
import javax.management.ReflectionException;
import javax.naming.InitialContext;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
public class JMXModel {
protected static JMXModel instance;
@@ -251,6 +254,8 @@
tmp.loadValue(connection);
wrapped.add(tmp);
} catch( Exception e ) {
+ // some attributes may not load because the result is not serializable.
+ // no need to report every error
}
}
attributes = (WrappedMBeanAttributeInfo[]) wrapped.toArray(new WrappedMBeanAttributeInfo[wrapped.size()]);
@@ -379,7 +384,9 @@
r.run(connection);
}
} catch (Exception e) {
- e.printStackTrace();
+ JBossServerCorePlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Error while running JMX-safe code", e));
}
Thread.currentThread().setContextClassLoader(currentLoader);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -22,6 +22,7 @@
import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.eclipse.wst.server.core.model.PublishOperation;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory;
@@ -172,16 +173,16 @@
* hack for eclipse bug 169570
*/
public IStatus publishOneModule(IModule[] module, int kind, int deltaKind, boolean recurse, IProgressMonitor monitor) {
+ try {
- // add it to the server first
- if( module.length == 1 )
- addAndRemoveModules(module, deltaKind);
+ // add it to the server first
+ if( module.length == 1 )
+ addAndRemoveModules(module, deltaKind);
- ArrayList moduleList = new ArrayList();
- ArrayList deltaKindList = new ArrayList();
- fillPublishOneModuleLists(module, moduleList, deltaKindList, deltaKind, recurse);
+ ArrayList moduleList = new ArrayList();
+ ArrayList deltaKindList = new ArrayList();
+ fillPublishOneModuleLists(module, moduleList, deltaKindList, deltaKind, recurse);
- try {
((Server)getServer()).getServerPublishInfo().startCaching();
@@ -210,10 +211,12 @@
return Status.OK_STATUS;
- } catch( Exception e ) {
-
+ } catch( CoreException e ) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception publishing one module: ", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
+ return s;
}
- return Status.CANCEL_STATUS;
}
protected void fillPublishOneModuleLists(IModule[] module, ArrayList moduleList, ArrayList deltaKindList, int deltaKind, boolean recurse) {
@@ -239,19 +242,18 @@
}
}
- protected void addAndRemoveModules(IModule[] module, int deltaKind) {
+ protected void addAndRemoveModules(IModule[] module, int deltaKind) throws CoreException {
if( getServer() == null ) return;
boolean contains = ServerUtil.containsModule(getServer(), module[0], new NullProgressMonitor());
- try {
- if( !contains && (deltaKind == ServerBehaviourDelegate.ADDED) || (deltaKind == ServerBehaviourDelegate.CHANGED)) {
- IServerWorkingCopy wc = getServer().createWorkingCopy();
- ServerUtil.modifyModules(wc, module, new IModule[0], new NullProgressMonitor());
- wc.save(false, new NullProgressMonitor());
- } else if( contains && deltaKind == ServerBehaviourDelegate.REMOVED) {
- IServerWorkingCopy wc = getServer().createWorkingCopy();
- ServerUtil.modifyModules(wc, new IModule[0], module, new NullProgressMonitor());
- wc.save(false, new NullProgressMonitor());
- }
- } catch( Exception e ) {} // swallowed
+
+ if( !contains && (deltaKind == ServerBehaviourDelegate.ADDED) || (deltaKind == ServerBehaviourDelegate.CHANGED)) {
+ IServerWorkingCopy wc = getServer().createWorkingCopy();
+ ServerUtil.modifyModules(wc, module, new IModule[0], new NullProgressMonitor());
+ wc.save(false, new NullProgressMonitor());
+ } else if( contains && deltaKind == ServerBehaviourDelegate.REMOVED) {
+ IServerWorkingCopy wc = getServer().createWorkingCopy();
+ ServerUtil.modifyModules(wc, new IModule[0], module, new NullProgressMonitor());
+ wc.save(false, new NullProgressMonitor());
+ }
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -2,6 +2,7 @@
import java.io.FileInputStream;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
@@ -92,8 +93,8 @@
url = new URL(url, path);
}
return new HttpLaunchable(url);
- } catch (Exception e) {
- return null;
+ } catch (MalformedURLException e) {
+ return null; // no launchable available.
}
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/NestedPublishInfo.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -1,99 +0,0 @@
-package org.jboss.ide.eclipse.as.core.server.internal;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.ModulePublishInfo;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-
-
-
-public class NestedPublishInfo {
- public static final String PUBLISH_INFO = "publishInfo";
- public static final String INDEX = "index.properties";
- private static NestedPublishInfo instance;
-
-
- public static NestedPublishInfo getDefault() {
- if( instance == null ) {
- instance = new NestedPublishInfo();
- }
- return instance;
- }
-
- HashMap idToSPI;
- protected NestedPublishInfo() {
- idToSPI = new HashMap();
- }
-
- public NestedServerPublishInfo getServerPublishInfo(IServer server) {
- if( idToSPI.get(server.getId()) == null ) {
- idToSPI.put(server.getId(), new NestedServerPublishInfo());
- }
- return (NestedServerPublishInfo)idToSPI.get(server.getId());
- }
-
- public static class NestedServerPublishInfo {
-
- private HashMap<String, OpenedModulePublishInfo> idToModulePublishInfo;
- public NestedServerPublishInfo() {
- idToModulePublishInfo = new HashMap<String, OpenedModulePublishInfo>();
- }
-
- public ModulePublishInfo getPublishInfo(ArrayList ids, IModule module) {
- String id = getId(ids);
- ModulePublishInfo ret = idToModulePublishInfo.get(id);
- if( ret == null ) {
- ret = new OpenedModulePublishInfo(id, module.getName(), module.getModuleType());
- idToModulePublishInfo.put(id, (OpenedModulePublishInfo) ret);
- }
- return ret;
- }
-
- // Takes a list of the nesting pattern for the modules
- // followed by the desired module (which can share its current resources)
- public IModuleResourceDelta[] getDelta(ArrayList ids, IModule module) {
- return ((OpenedModulePublishInfo)getPublishInfo(ids, module)).getDelta(new IModule[]{module});
- }
-
- protected String getId(ArrayList ids) {
- String result = "";
- Iterator i = ids.iterator();
- while(i.hasNext()) {
- result += i.next().hashCode() + "" + Path.SEPARATOR;
- }
- return result;
- }
- }
-
- public static class OpenedModulePublishInfo extends ModulePublishInfo {
-
- public OpenedModulePublishInfo(DataInput in) throws IOException {
- super(in);
- }
-
- public OpenedModulePublishInfo(String moduleId, String name, IModuleType moduleType) {
- super(moduleId, name, moduleType);
- }
-
- public IModuleResourceDelta[] getDelta(IModule[] module) {
- return super.getDelta(module);
- }
-
- public void load(DataInput in) throws IOException {
- super.load(in);
- }
-
- public void save(DataOutput out) {
- super.save(out);
- }
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerAttributeHelper.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -26,11 +26,14 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
/**
* This class just opens up the get and set attributes for a server,
@@ -113,7 +116,11 @@
public IServer save() {
try {
return save(false, new NullProgressMonitor());
- } catch( Exception e ) {}
+ } catch( Exception e ) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception while saving server metadata: ", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
+ }
return null;
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -1,6 +1,9 @@
package org.jboss.ide.eclipse.as.core.server.internal;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
public class ServerStatePollerType {
@@ -24,6 +27,9 @@
try {
return (IServerStatePoller)el.createExecutableExtension("class");
} catch( Exception e ) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Error instantiating Server Poller: " + el.getAttribute("name"), e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
}
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -127,15 +127,17 @@
protected static ArrayList<String> convertClasspath(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall vmInstall) {
if (vmInstall != null) {
- try {
- cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(
- new Path(JavaRuntime.JRE_CONTAINER).append(
- "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType")
- .append(vmInstall.getName()),
- IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
- } catch (Exception e) {
- // ignore
- }
+ try {
+ cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(
+ new Path(JavaRuntime.JRE_CONTAINER).append(
+ "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType")
+ .append(vmInstall.getName()),
+ IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
+ } catch (CoreException e) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception converting launch classpath: ", e);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
+ }
IPath jrePath = new Path(vmInstall.getInstallLocation()
.getAbsolutePath());
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2007-10-17 01:13:54 UTC (rev 4277)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2007-10-17 01:52:42 UTC (rev 4278)
@@ -5,8 +5,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -15,6 +17,7 @@
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
@@ -31,6 +34,9 @@
wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
} catch( CoreException ce ) {
// report it from here
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ "Unexpected Exception launching stop server command: ", ce);
+ JBossServerCorePlugin.getDefault().getLog().log(s);
}
}
17 years, 3 months
JBoss Tools SVN: r4277 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: server/internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-10-16 21:13:54 -0400 (Tue, 16 Oct 2007)
New Revision: 4277
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
Log:
Improved event logs for SingleFilePublisher ONLY.
JBIDE-1047
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-10-17 00:49:40 UTC (rev 4276)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-10-17 01:13:54 UTC (rev 4277)
@@ -9,25 +9,35 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory.SingleDeployableModuleDelegate;
+import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.CoppiedEvent;
+import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.DeletedEvent;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
public class SingleFilePublisher implements IJBossServerPublisher {
private IDeployableServer server;
- public SingleFilePublisher(IServer server) {
+ private EventLogTreeItem root;
+ private int publishState = IServer.PUBLISH_STATE_NONE;
+ public SingleFilePublisher(IServer server, EventLogTreeItem root) {
this.server = ServerConverter.getDeployableServer(server);
+ this.root = root;
}
public int getPublishState() {
- return IServer.PUBLISH_STATE_NONE;
+ return publishState;
}
public IStatus publishModule(int kind, int deltaKind,
@@ -50,32 +60,37 @@
}
protected IStatus publish(IDeployableServer server, IModule module, int kind, int deltaKind,
- int modulePublishState, boolean updateTimestamp, IProgressMonitor monitor) {
+ int modulePublishState, boolean updateTimestamp, IProgressMonitor monitor) throws CoreException {
SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
if( delegate != null ) {
IPath sourcePath = delegate.getGlobalSourcePath();
IPath destFolder = new Path(server.getDeployDirectory());
File destFile = destFolder.append(sourcePath.lastSegment()).toFile();
- FileUtil.fileSafeCopy(sourcePath.toFile(), destFile);
+ FileUtilListener l = new FileUtilListener(root);
+ FileUtil.fileSafeCopy(sourcePath.toFile(), destFile, l);
if( updateTimestamp )
destFile.setLastModified(new Date().getTime());
+ if( l.errorFound ) publishState = IServer.PUBLISH_STATE_FULL;
} else {
- // deleted module. o noes.
- IPath destFolder = new Path(server.getDeployDirectory());
- IPath destFile = destFolder.append(new Path(module.getName()).lastSegment());
- destFile.toFile().delete();
+ // deleted module. o noes. Ignore it. We can't re-publish it, so just ignore it.
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "The module cannot be published because it cannot be located"));
}
return null;
}
- protected IStatus unpublish(IDeployableServer server, IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
+ protected IStatus unpublish(IDeployableServer server, IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) throws CoreException {
// delete file
SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
if( delegate != null ) {
IPath sourcePath = delegate.getGlobalSourcePath();
IPath destFolder = new Path(server.getDeployDirectory());
- FileUtil.safeDelete(destFolder.append(sourcePath.lastSegment()).toFile());
+ FileUtilListener l = new FileUtilListener(root);
+ FileUtil.safeDelete(destFolder.append(sourcePath.lastSegment()).toFile(), l);
+ if( l.errorFound ) {
+ publishState = IServer.PUBLISH_STATE_FULL;
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Unable to delete module from server.", new Exception("Some files were not removed from the server")));
+ }
}
return null;
@@ -84,4 +99,33 @@
// ignore delta
}
+ public static class FileUtilListener implements IFileUtilListener {
+ protected EventLogTreeItem root;
+ protected boolean errorFound = false;
+ public FileUtilListener(EventLogTreeItem root) {
+ this.root = root;
+ }
+ public void fileCoppied(File source, File dest, boolean result,Exception e) {
+ if( result == false || e != null ) {
+ errorFound = true;
+ new CoppiedEvent(root, source, dest, result, e);
+ EventLogModel.markChanged(root);
+ }
+ }
+ public void fileDeleted(File file, boolean result, Exception e) {
+ if( result == false || e != null ) {
+ errorFound = true;
+ new DeletedEvent(root, file, result, e);
+ EventLogModel.markChanged(root);
+ }
+ }
+ public void folderDeleted(File file, boolean result, Exception e) {
+ if( result == false || e != null ) {
+ errorFound = true;
+ new DeletedEvent(root, file, result, e);
+ EventLogModel.markChanged(root);
+ }
+ }
+ };
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-10-17 00:49:40 UTC (rev 4276)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-10-17 01:13:54 UTC (rev 4277)
@@ -113,7 +113,7 @@
} else if( isPackagesTypeModule(lastMod) ) {
publisher = new PackagesPublisher(getServer(), root);
} else if( lastMod.getModuleType().getId().equals("jboss.singlefile")){
- publisher = new SingleFilePublisher(getServer());
+ publisher = new SingleFilePublisher(getServer(), root);
} else {
publisher = new NullPublisher();
}
17 years, 3 months
JBoss Tools SVN: r4276 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-10-16 20:49:40 -0400 (Tue, 16 Oct 2007)
New Revision: 4276
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
Log:
Improved event logs for JSTPublisher ONLY.
JBIDE-1047
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-10-16 23:57:49 UTC (rev 4275)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-10-17 00:49:40 UTC (rev 4276)
@@ -26,6 +26,7 @@
import java.io.IOException;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -85,18 +86,21 @@
int modulePublishState, IModule[] module, IProgressMonitor monitor)
throws CoreException {
IStatus status = null;
-
+ boolean deleted = false;
for( int i = 0; i < module.length; i++ ) {
if( module[i] instanceof DeletedModule )
- // TODO FIX ME
- return null;
+ deleted = true;
}
if (ServerBehaviourDelegate.REMOVED == deltaKind) {
status = unpublish(server, module, monitor);
} else if (kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN) {
+ if( deleted )
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "The module cannot be published because it cannot be located"));
status = fullPublish(module, module[module.length-1], monitor);
} else if (kind == IServer.PUBLISH_INCREMENTAL || kind == IServer.PUBLISH_AUTO) {
+ if( deleted )
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "The module cannot be published because it cannot be located"));
status = incrementalPublish(module, module[module.length-1], monitor);
}
return status;
@@ -160,17 +164,20 @@
protected IPath getDeployPath(IModule[] moduleTree) {
IPath root = new Path( server.getDeployDirectory() );
- String type;
+ String type, name;
+ IProject project;
for( int i = 0; i < moduleTree.length; i++ ) {
type = moduleTree[i].getModuleType().getId();
+ project = moduleTree[i].getProject();
+ name = project == null ? moduleTree[i].getName() : project.getName();
if( "jst.ear".equals(type))
- root = root.append(moduleTree[i].getProject().getName() + ".ear");
+ root = root.append(name + ".ear");
else if( "jst.web".equals(type))
- root = root.append(moduleTree[i].getProject().getName() + ".war");
+ root = root.append(name + ".war");
else if( "jst.utility".equals(type) && i >= 1 && "jst.web".equals(moduleTree[i-1].getModuleType().getId()))
- root = root.append("WEB-INF").append("lib").append(moduleTree[i].getProject().getName() + ".jar");
+ root = root.append("WEB-INF").append("lib").append(name + ".jar");
else
- root = root.append(moduleTree[i].getProject().getName() + ".jar");
+ root = root.append(name + ".jar");
}
return root;
}
17 years, 3 months