JBoss Tools SVN: r30551 - in workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped: .settings and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-13 08:44:34 -0400 (Wed, 13 Apr 2011)
New Revision: 30551
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.project
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.settings/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.settings/org.eclipse.jdt.core.prefs
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT-sources.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT-sources.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT-sources.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-dmr-1.0.0.Beta5-sources.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-dmr-1.0.0.Beta5.jar
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DeployerException.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java
Log:
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath 2011-04-13 12:44:34 UTC (rev 30551)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Beta5.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar" sourcepath="/jboss-as-cli"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.project
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.project (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.project 2011-04-13 12:44:34 UTC (rev 30551)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as7.deployment.detyped</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.settings/org.eclipse.jdt.core.prefs 2011-04-13 12:44:34 UTC (rev 30551)
@@ -0,0 +1,8 @@
+#Wed Apr 13 13:48:52 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF 2011-04-13 12:44:34 UTC (rev 30551)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Detyped
+Bundle-SymbolicName: org.jboss.ide.eclipse.as7.deployment.detyped
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: .,
+ jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar,
+ jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar,
+ jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar,
+ jboss-dmr-1.0.0.Beta5.jar
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties 2011-04-13 12:44:34 UTC (rev 30551)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar,\
+ jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar,\
+ jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar,\
+ jboss-dmr-1.0.0.Beta5.jar
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/build.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT-sources.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-cli-7.0.0.Beta3-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT-sources.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT-sources.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-dmr-1.0.0.Beta5-sources.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-dmr-1.0.0.Beta5-sources.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-dmr-1.0.0.Beta5.jar
===================================================================
(Binary files differ)
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/jboss-dmr-1.0.0.Beta5.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DeployerException.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DeployerException.java (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DeployerException.java 2011-04-13 12:44:34 UTC (rev 30551)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are 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
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.ide.eclipse.as7.deployment.detyped;
+
+/**
+ * @author André Dietisheim
+ */
+public class DeployerException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public DeployerException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public DeployerException(Throwable cause) {
+ super(cause);
+ }
+
+ public DeployerException(String message) {
+ super(message);
+ }
+
+}
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/DeployerException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java 2011-04-13 12:44:34 UTC (rev 30551)
@@ -0,0 +1,149 @@
+package org.jboss.ide.eclipse.as7.deployment.detyped;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CancellationException;
+
+import org.jboss.as.cli.operation.OperationFormatException;
+import org.jboss.as.cli.operation.OperationRequestBuilder;
+import org.jboss.as.cli.operation.impl.DefaultOperationRequestBuilder;
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.protocol.StreamUtils;
+import org.jboss.dmr.ModelNode;
+
+public class StandaloneDetypedOperations {
+
+ private final List<IDeploymentOperation> deployments = new ArrayList<IDeploymentOperation>();
+ private final ModelControllerClient client;
+
+ public StandaloneDetypedOperations(String host, int port) throws UnknownHostException {
+ client = ModelControllerClient.Factory.create(host, port);
+ }
+
+ public synchronized StandaloneDetypedOperations deploy(File file) {
+ deployments.add(new DeployOperation(file));
+ return this;
+ }
+
+ public synchronized StandaloneDetypedOperations deploy(String name, File file) {
+ deployments.add(new DeployOperation(name, file));
+ return this;
+ }
+
+ public synchronized StandaloneDetypedOperations undeploy(String name) {
+ deployments.add(new UndeployOperation(name));
+ return this;
+ }
+
+ public synchronized StandaloneDetypedOperations undeploy(File file) {
+ deployments.add(new UndeployOperation(file));
+ return this;
+ }
+
+ public synchronized void execute() throws DeployerException {
+ try {
+ for (IDeploymentOperation operation : deployments) {
+ operation.execute();
+ }
+ } catch (Exception e) {
+ throw new DeployerException(e);
+ }
+ }
+
+ public void dispose() {
+ StreamUtils.safeClose(client);
+ }
+
+ private class DeployOperation extends FileOperation {
+
+ private DeployOperation(File file) {
+ super(file);
+ }
+
+ private DeployOperation(String name, File file) {
+ super(name, file);
+ }
+
+ public void execute() throws OperationFormatException, CancellationException, IOException {
+ OperationRequestBuilder builder = new DefaultOperationRequestBuilder();
+ builder.setOperationName("deploy");
+ builder.addNode("deployment", name);
+ ModelNode request = builder.buildRequest();
+ ModelNode result = client.execute(request);
+ }
+ }
+
+ private class UndeployOperation extends FileOperation {
+
+ private UndeployOperation(File file) {
+ super(file);
+ }
+
+ private UndeployOperation(String name) {
+ super(name, null);
+ }
+
+ public void execute() throws OperationFormatException, CancellationException, IOException {
+ DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
+
+ builder = new DefaultOperationRequestBuilder();
+ builder.setOperationName("undeploy");
+ builder.addNode("deployment", getName());
+
+ ModelNode request = builder.buildRequest();
+ ModelNode result = client.execute(request);
+
+ // remove
+ builder = new DefaultOperationRequestBuilder();
+ builder.setOperationName("remove");
+ builder.addNode("deployment", getName());
+ request = builder.buildRequest();
+ result = client.execute(request);
+ }
+ }
+
+ private abstract static class FileOperation extends NamedOperation {
+
+ private File file;
+
+ private FileOperation(File file) {
+ this(null, file);
+ }
+
+ private FileOperation(String name, File file) {
+ super(name);
+ this.file = file;
+ }
+
+ protected File getFile() {
+ return file;
+ }
+
+ protected String getName() {
+ if (name != null) {
+ return name;
+ } else {
+ return file.getName();
+ }
+ }
+ }
+
+ private abstract static class NamedOperation implements IDeploymentOperation {
+
+ protected String name;
+
+ private NamedOperation(String name) {
+ this.name = name;
+ }
+ }
+
+ private interface IDeploymentOperation {
+
+ public void execute() throws Exception;
+
+ }
+
+}
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.detyped/src/org/jboss/ide/eclipse/as7/deployment/detyped/StandaloneDetypedOperations.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r30549 - workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-13 07:56:21 -0400 (Wed, 13 Apr 2011)
New Revision: 30549
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java
Log:
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java 2011-04-13 11:51:56 UTC (rev 30548)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java 2011-04-13 11:56:21 UTC (rev 30549)
@@ -36,7 +36,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.jboss.ide.eclipse.as7.deployment.DeployerException;
-import org.jboss.ide.eclipse.as7.deployment.StandaloneOperations;
+import org.jboss.ide.eclipse.as7.deployment.StandaloneTypedOperations;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -58,12 +58,10 @@
@Test
public void canDeploy() throws Exception {
- StandaloneOperations deployer = null;
+ StandaloneTypedOperations deployer = null;
File warFile = getWarFile("minimalistic.war");
try {
- deployer = new StandaloneOperations(HOST, MGMT_PORT);
- quietlyUndeploy(warFile, deployer); // make sure doesn't
- // exist
+ deployer = new StandaloneTypedOperations(HOST, MGMT_PORT);
deployer.deploy(warFile).execute();
String response = getServerResponse(new URL(
@@ -78,10 +76,10 @@
@Test(expected = DeployerException.class)
public void cannotDeployWarTwice() throws Exception {
- StandaloneOperations deployer = null;
+ StandaloneTypedOperations deployer = null;
File warFile = getWarFile("minimalistic.war");
try {
- deployer = new StandaloneOperations(HOST, MGMT_PORT);
+ deployer = new StandaloneTypedOperations(HOST, MGMT_PORT);
deployer.deploy(warFile).execute();
deployer.deploy(warFile).execute();
} finally {
@@ -115,10 +113,10 @@
return writer.toString();
}
- private void quietlyUndeploy(File file, StandaloneOperations deployer) {
+ private void quietlyUndeploy(File file, StandaloneTypedOperations deployer) {
try {
if (deployer != null) {
- deployer.undeploy(file);
+ deployer.undeploy(file).execute();
deployer.dispose();
}
} catch (Exception e) {
13 years, 7 months
JBoss Tools SVN: r30548 - workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-13 07:51:56 -0400 (Wed, 13 Apr 2011)
New Revision: 30548
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDetypedOperations.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneTypedOperations.java
Removed:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java
Log:
Added: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDetypedOperations.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDetypedOperations.java (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDetypedOperations.java 2011-04-13 11:51:56 UTC (rev 30548)
@@ -0,0 +1,143 @@
+package org.jboss.ide.eclipse.as7.deployment;
+
+import static org.jboss.as.protocol.StreamUtils.safeClose;
+
+import java.io.File;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
+
+public class StandaloneDetypedOperations {
+
+ public static final long DEFAULT_TIMEOUT = 15000;
+
+ private final List<IDeploymentPlanBuilderOperation> deployments = new ArrayList<IDeploymentPlanBuilderOperation>();
+ private final ModelControllerClient client;
+ private final ServerDeploymentManager manager;
+ private long timeout = DEFAULT_TIMEOUT;
+
+ public StandaloneDetypedOperations(String host, int port) throws UnknownHostException {
+ client = ModelControllerClient.Factory.create(host, port);
+ manager = ServerDeploymentManager.Factory.create(client);
+ }
+
+ public synchronized StandaloneDetypedOperations deploy(File file) {
+ deployments.add(new DeployOperation(file));
+ return this;
+ }
+
+ public synchronized StandaloneDetypedOperations deploy(String name, File file) {
+ deployments.add(new DeployOperation(name, file));
+ return this;
+ }
+
+ public synchronized StandaloneDetypedOperations undeploy(String name) {
+ deployments.add(new UndeployOperation(name));
+ return this;
+ }
+
+ public synchronized StandaloneDetypedOperations undeploy(File file) {
+ deployments.add(new UndeployOperation(file));
+ return this;
+ }
+
+ public synchronized void execute() throws DeployerException {
+ try {
+ DeploymentPlanBuilder builder = manager.newDeploymentPlan();
+ for (IDeploymentPlanBuilderOperation deployment : deployments) {
+ builder = deployment.addTo(builder);
+ }
+ manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
+ } catch (Exception e) {
+ throw new DeployerException(e);
+ }
+ }
+
+ public void setTimeout(long timeout) {
+ this.timeout = timeout;
+ }
+
+ public void dispose() {
+ safeClose(client);
+ }
+
+ private static class DeployOperation extends FileOperation {
+
+ private DeployOperation(File file) {
+ super(file);
+ }
+
+ private DeployOperation(String name, File file) {
+ super(name, file);
+ }
+
+ public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
+ String name = getName();
+ return builder.add(name, getFile()).deploy(name);
+ }
+ }
+
+ private static class UndeployOperation extends FileOperation {
+
+ private UndeployOperation(File file) {
+ super(file);
+ }
+
+ private UndeployOperation(String name) {
+ super(name, null);
+ }
+
+ public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
+ String name = getName();
+ return builder.undeploy(name).undeploy(name);
+ }
+ }
+
+ private abstract static class FileOperation extends NamedOperation {
+
+ private File file;
+
+ private FileOperation(File file) {
+ this(null, file);
+ }
+
+ private FileOperation(String name, File file) {
+ super(name);
+ this.file = file;
+ }
+
+ protected File getFile() {
+ return file;
+ }
+
+ protected String getName() {
+ if (name != null) {
+ return name;
+ } else {
+ return file.getName();
+ }
+ }
+
+ }
+
+ private abstract static class NamedOperation implements IDeploymentPlanBuilderOperation {
+
+ protected String name;
+
+ private NamedOperation(String name) {
+ this.name = name;
+ }
+ }
+
+ private interface IDeploymentPlanBuilderOperation {
+
+ public DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception;
+
+ }
+
+}
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDetypedOperations.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java 2011-04-13 09:11:43 UTC (rev 30547)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java 2011-04-13 11:51:56 UTC (rev 30548)
@@ -1,170 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.ide.eclipse.as7.deployment;
-
-import static org.jboss.as.protocol.StreamUtils.safeClose;
-
-import java.io.File;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.jboss.as.controller.client.ModelControllerClient;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
-
-/**
- * Used to deploy/undeploy deployments to a running <b>standalone</b>
- * application server
- *
- * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
- * @author <a href="adietish(a)redhat.com">André Dietisheim</a>
- */
-public class StandaloneOperations {
-
- public static final long DEFAULT_TIMEOUT = 15000;
-
- private final List<IDeploymentPlanBuilderOperation> deployments = new ArrayList<IDeploymentPlanBuilderOperation>();
- private final ModelControllerClient client;
- private final ServerDeploymentManager manager;
- private long timeout = DEFAULT_TIMEOUT;
-
- public StandaloneOperations(String host, int port) throws UnknownHostException {
- client = ModelControllerClient.Factory.create(host, port);
- manager = ServerDeploymentManager.Factory.create(client);
- }
-
- public synchronized StandaloneOperations deploy(File file) {
- deployments.add(new DeployOperation(file));
- return this;
- }
-
- public synchronized StandaloneOperations deploy(String name, File file) {
- deployments.add(new DeployOperation(name, file));
- return this;
- }
-
- public synchronized StandaloneOperations undeploy(String name) {
- deployments.add(new UndeployOperation(name));
- return this;
- }
-
- public synchronized StandaloneOperations undeploy(File file) {
- deployments.add(new UndeployOperation(file));
- return this;
- }
-
- public synchronized void execute() throws DeployerException {
- try {
- DeploymentPlanBuilder builder = manager.newDeploymentPlan();
- for (IDeploymentPlanBuilderOperation deployment : deployments) {
- builder = deployment.addTo(builder);
- }
- manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
- } catch (Exception e) {
- throw new DeployerException(e);
- }
- }
-
- public void setTimeout(long timeout) {
- this.timeout = timeout;
- }
-
- public void dispose() {
- safeClose(client);
- }
-
- private static class DeployOperation extends FileOperation {
-
- private DeployOperation(File file) {
- super(file);
- }
-
- private DeployOperation(String name, File file) {
- super(name, file);
- }
-
- public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
- String name = getName();
- return builder.add(name, getFile()).deploy(name);
- }
- }
-
- private static class UndeployOperation extends FileOperation {
-
- private UndeployOperation(File file) {
- super(file);
- }
-
- private UndeployOperation(String name) {
- super(name, null);
- }
-
- public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
- String name = getName();
- return builder.undeploy(name).undeploy(name);
- }
- }
-
- private abstract static class FileOperation extends NamedOperation {
-
- private File file;
-
- private FileOperation(File file) {
- this(null, file);
- }
-
- private FileOperation(String name, File file) {
- super(name);
- this.file = file;
- }
-
- protected File getFile() {
- return file;
- }
-
- protected String getName() {
- if (name != null) {
- return name;
- } else {
- return file.getName();
- }
- }
-
- }
-
- private abstract static class NamedOperation implements IDeploymentPlanBuilderOperation {
-
- protected String name;
-
- private NamedOperation(String name) {
- this.name = name;
- }
- }
-
- private interface IDeploymentPlanBuilderOperation {
-
- public DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception;
-
- }
-}
Copied: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneTypedOperations.java (from rev 30547, workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java)
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneTypedOperations.java (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneTypedOperations.java 2011-04-13 11:51:56 UTC (rev 30548)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.ide.eclipse.as7.deployment;
+
+import static org.jboss.as.protocol.StreamUtils.safeClose;
+
+import java.io.File;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
+
+/**
+ * Used to deploy/undeploy deployments to a running <b>standalone</b>
+ * application server
+ *
+ * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
+ * @author <a href="adietish(a)redhat.com">André Dietisheim</a>
+ */
+public class StandaloneTypedOperations {
+
+ public static final long DEFAULT_TIMEOUT = 15000;
+
+ private final List<IDeploymentPlanBuilderOperation> deployments = new ArrayList<IDeploymentPlanBuilderOperation>();
+ private final ModelControllerClient client;
+ private final ServerDeploymentManager manager;
+ private long timeout = DEFAULT_TIMEOUT;
+
+ public StandaloneTypedOperations(String host, int port) throws UnknownHostException {
+ client = ModelControllerClient.Factory.create(host, port);
+ manager = ServerDeploymentManager.Factory.create(client);
+ }
+
+ public synchronized StandaloneTypedOperations deploy(File file) {
+ deployments.add(new DeployOperation(file));
+ return this;
+ }
+
+ public synchronized StandaloneTypedOperations deploy(String name, File file) {
+ deployments.add(new DeployOperation(name, file));
+ return this;
+ }
+
+ public synchronized StandaloneTypedOperations undeploy(String name) {
+ deployments.add(new UndeployOperation(name));
+ return this;
+ }
+
+ public synchronized StandaloneTypedOperations undeploy(File file) {
+ deployments.add(new UndeployOperation(file));
+ return this;
+ }
+
+ public synchronized void execute() throws DeployerException {
+ try {
+ DeploymentPlanBuilder builder = manager.newDeploymentPlan();
+ for (IDeploymentPlanBuilderOperation deployment : deployments) {
+ builder = deployment.addTo(builder);
+ }
+ manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
+ } catch (Exception e) {
+ throw new DeployerException(e);
+ }
+ }
+
+ public void setTimeout(long timeout) {
+ this.timeout = timeout;
+ }
+
+ public void dispose() {
+ safeClose(client);
+ }
+
+ private static class DeployOperation extends FileOperation {
+
+ private DeployOperation(File file) {
+ super(file);
+ }
+
+ private DeployOperation(String name, File file) {
+ super(name, file);
+ }
+
+ public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
+ String name = getName();
+ return builder.add(name, getFile()).deploy(name);
+ }
+ }
+
+ private static class UndeployOperation extends FileOperation {
+
+ private UndeployOperation(File file) {
+ super(file);
+ }
+
+ private UndeployOperation(String name) {
+ super(name, null);
+ }
+
+ public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
+ String name = getName();
+ return builder.undeploy(name).undeploy(name);
+ }
+ }
+
+ private abstract static class FileOperation extends NamedOperation {
+
+ private File file;
+
+ private FileOperation(File file) {
+ this(null, file);
+ }
+
+ private FileOperation(String name, File file) {
+ super(name);
+ this.file = file;
+ }
+
+ protected File getFile() {
+ return file;
+ }
+
+ protected String getName() {
+ if (name != null) {
+ return name;
+ } else {
+ return file.getName();
+ }
+ }
+
+ }
+
+ private abstract static class NamedOperation implements IDeploymentPlanBuilderOperation {
+
+ protected String name;
+
+ private NamedOperation(String name) {
+ this.name = name;
+ }
+ }
+
+ private interface IDeploymentPlanBuilderOperation {
+
+ public DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception;
+
+ }
+}
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneTypedOperations.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r30547 - in workspace/adietish: org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-13 05:11:43 -0400 (Wed, 13 Apr 2011)
New Revision: 30547
Added:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java
Removed:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath
Log:
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath 2011-04-13 03:47:54 UTC (rev 30546)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.classpath 2011-04-13 09:11:43 UTC (rev 30547)
@@ -2,12 +2,12 @@
<classpath>
<classpathentry exported="true" kind="lib" path="jboss-threads-2.0.0.CR8.jar" sourcepath="jboss-threads-2.0.0.CR8-sources.jar"/>
<classpathentry exported="true" kind="lib" path="jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar" sourcepath="jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar" sourcepath="jboss-as-protocol-7.0.0.Beta3-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Beta5.jar" sourcepath="jboss-dmr-1.0.0.Beta5-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="jboss-marshalling-1.3.0.CR8.jar" sourcepath="jboss-marshalling-1.3.0.CR8-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-as-protocol-7.0.0.Beta3-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-dmr-1.0.0.Beta5.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-logging-3.0.0.Beta3.jar"/>
+ <classpathentry exported="true" kind="lib" path="jboss-marshalling-1.3.0.CR8.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="lib" path="jboss-logging-3.0.0.Beta3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Deleted: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java 2011-04-13 03:47:54 UTC (rev 30546)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java 2011-04-13 09:11:43 UTC (rev 30547)
@@ -1,185 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.ide.eclipse.as7.deployment;
-
-import static org.jboss.as.protocol.StreamUtils.safeClose;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
-import org.jboss.as.controller.client.ModelControllerClient;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlan;
-import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
-import org.jboss.as.controller.client.helpers.standalone.DuplicateDeploymentNameException;
-import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
-
-/**
- * Used to deploy/undeploy deployments to a running <b>standalone</b>
- * application server
- *
- * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
- * @author <a href="adietish(a)redhat.com">André Dietisheim</a>
- */
-public class StandaloneDeployer {
-
- public static final long DEFAULT_TIMEOUT = 15000;
-
- private final List<AbstractDeployable> deployments = new ArrayList<AbstractDeployable>();
- private final ModelControllerClient client;
- private final ServerDeploymentManager manager;
- private long timeout = DEFAULT_TIMEOUT;
-
- public StandaloneDeployer(String host, int port) throws UnknownHostException {
- client = ModelControllerClient.Factory.create(host, port);
- manager = ServerDeploymentManager.Factory.create(client);
- }
-
- public synchronized StandaloneDeployer addWar(File file) {
- deployments.add(new WarDeployable(file));
- return this;
- }
-
- public synchronized StandaloneDeployer addWarDeployment(String name, File file) {
- deployments.add(new WarDeployable(name, file));
- return this;
- }
-
- public synchronized void deploy() throws DuplicateDeploymentNameException, IOException, ExecutionException,
- InterruptedException, TimeoutException {
- DeploymentPlanBuilder builder = manager.newDeploymentPlan();
- for (AbstractDeployable deployment : deployments) {
- builder = deployment.addDeployment(builder);
- }
-
- try {
- manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
- } finally {
- markDeploymentsDeployed();
- }
- }
-
- private void markDeploymentsDeployed() {
- for (AbstractDeployable deployment : deployments) {
- deployment.deployed = true;
- }
- }
-
- public synchronized void undeploy() throws ExecutionException, InterruptedException, TimeoutException {
- DeploymentPlanBuilder builder = manager.newDeploymentPlan();
- for (AbstractDeployable deployment : deployments) {
- builder = deployment.removeDeployment(builder);
- }
- DeploymentPlan plan = builder.build();
- if (plan.getDeploymentActions().size() > 0) {
- manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
- }
- }
-
- public MBeanServerConnection getConnection() throws Exception {
- return JMXConnectorFactory.connect(new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi"),
- new HashMap<String, Object>()).getMBeanServerConnection();
- }
-
- public String showJndi() throws Exception {
- return (String) getConnection().invoke(new ObjectName("jboss:type=JNDIView"), "list", new Object[] { true },
- new String[] { "boolean" });
- }
-
- public long getTimeout() {
- return timeout;
- }
-
- public void setTimeout(long timeout) {
- this.timeout = timeout;
- }
-
- public void dispose() {
- safeClose(client);
- }
-
- private abstract class AbstractDeployable {
-
- private boolean deployed;
-
- public synchronized DeploymentPlanBuilder addDeployment(DeploymentPlanBuilder builder)
- throws DuplicateDeploymentNameException, IOException, ExecutionException, InterruptedException {
- String name = getName();
- return builder.add(name, getFile()).deploy(name);
- }
-
- public synchronized DeploymentPlanBuilder removeDeployment(DeploymentPlanBuilder builder) {
- String name = getName();
- if (deployed) {
- return builder.undeploy(name).remove(name);
- }
- else {
- return builder;
- }
- }
-
- protected abstract String getName();
-
- protected abstract File getFile();
- }
-
- private class WarDeployable extends AbstractDeployable {
-
- private File file;
- private String name;
-
- public WarDeployable(String name, File file) {
- this(file);
- this.name = name;
- }
-
- public WarDeployable(File file) {
- this.file = file;
- }
-
- @Override
- protected File getFile() {
- return file;
- }
-
- @Override
- protected String getName() {
- if (name != null) {
- return name;
- } else {
- return file.getName();
- }
- }
-
- }
-}
Copied: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java (from rev 30533, workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneDeployer.java)
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java 2011-04-13 09:11:43 UTC (rev 30547)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.ide.eclipse.as7.deployment;
+
+import static org.jboss.as.protocol.StreamUtils.safeClose;
+
+import java.io.File;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder;
+import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager;
+
+/**
+ * Used to deploy/undeploy deployments to a running <b>standalone</b>
+ * application server
+ *
+ * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
+ * @author <a href="adietish(a)redhat.com">André Dietisheim</a>
+ */
+public class StandaloneOperations {
+
+ public static final long DEFAULT_TIMEOUT = 15000;
+
+ private final List<IDeploymentPlanBuilderOperation> deployments = new ArrayList<IDeploymentPlanBuilderOperation>();
+ private final ModelControllerClient client;
+ private final ServerDeploymentManager manager;
+ private long timeout = DEFAULT_TIMEOUT;
+
+ public StandaloneOperations(String host, int port) throws UnknownHostException {
+ client = ModelControllerClient.Factory.create(host, port);
+ manager = ServerDeploymentManager.Factory.create(client);
+ }
+
+ public synchronized StandaloneOperations deploy(File file) {
+ deployments.add(new DeployOperation(file));
+ return this;
+ }
+
+ public synchronized StandaloneOperations deploy(String name, File file) {
+ deployments.add(new DeployOperation(name, file));
+ return this;
+ }
+
+ public synchronized StandaloneOperations undeploy(String name) {
+ deployments.add(new UndeployOperation(name));
+ return this;
+ }
+
+ public synchronized StandaloneOperations undeploy(File file) {
+ deployments.add(new UndeployOperation(file));
+ return this;
+ }
+
+ public synchronized void execute() throws DeployerException {
+ try {
+ DeploymentPlanBuilder builder = manager.newDeploymentPlan();
+ for (IDeploymentPlanBuilderOperation deployment : deployments) {
+ builder = deployment.addTo(builder);
+ }
+ manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
+ } catch (Exception e) {
+ throw new DeployerException(e);
+ }
+ }
+
+ public void setTimeout(long timeout) {
+ this.timeout = timeout;
+ }
+
+ public void dispose() {
+ safeClose(client);
+ }
+
+ private static class DeployOperation extends FileOperation {
+
+ private DeployOperation(File file) {
+ super(file);
+ }
+
+ private DeployOperation(String name, File file) {
+ super(name, file);
+ }
+
+ public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
+ String name = getName();
+ return builder.add(name, getFile()).deploy(name);
+ }
+ }
+
+ private static class UndeployOperation extends FileOperation {
+
+ private UndeployOperation(File file) {
+ super(file);
+ }
+
+ private UndeployOperation(String name) {
+ super(name, null);
+ }
+
+ public synchronized DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception {
+ String name = getName();
+ return builder.undeploy(name).undeploy(name);
+ }
+ }
+
+ private abstract static class FileOperation extends NamedOperation {
+
+ private File file;
+
+ private FileOperation(File file) {
+ this(null, file);
+ }
+
+ private FileOperation(String name, File file) {
+ super(name);
+ this.file = file;
+ }
+
+ protected File getFile() {
+ return file;
+ }
+
+ protected String getName() {
+ if (name != null) {
+ return name;
+ } else {
+ return file.getName();
+ }
+ }
+
+ }
+
+ private abstract static class NamedOperation implements IDeploymentPlanBuilderOperation {
+
+ protected String name;
+
+ private NamedOperation(String name) {
+ this.name = name;
+ }
+ }
+
+ private interface IDeploymentPlanBuilderOperation {
+
+ public DeploymentPlanBuilder addTo(DeploymentPlanBuilder builder) throws Exception;
+
+ }
+}
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/deployment/StandaloneOperations.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java 2011-04-13 03:47:54 UTC (rev 30546)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java 2011-04-13 09:11:43 UTC (rev 30547)
@@ -1,128 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.ide.eclipse.as7.deployment.tests;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.HttpURLConnection;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.jboss.ide.eclipse.as7.deployment.StandaloneDeployer;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- *
- * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class StandaloneDeployerIntegrationTest {
-
- private static final String WAR_FOLDER = "/wars/";
- private static final String BUNDLE_ID = "org.jboss.ide.eclipse.as7.deployment.tests";
-
- private static final int WEBAPP_RESPONSE_TIMEOUT = 10 * 1024;
-
- private static final String HOST = "localhost";
- private static final int MGMT_PORT = 9999;
- private static final int WEB_PORT = 8080;
-
-
-
- @Test
- public void canDeploy() throws Exception {
- StandaloneDeployer deployer = null;
- try {
- File warFile = getWarFile("minimalistic.war");
- deployer = new StandaloneDeployer(HOST, MGMT_PORT);
- deployer.addWar(warFile).deploy();
-
- String response = getServerResponse(new URL(
- MessageFormat.format("http://{0}:{1}/{2}",
- HOST, String.valueOf(WEB_PORT), "minimalistic")));
- assertTrue(response.indexOf("minimalistic") >= 0);
-
- } finally {
- quietlyCleanup(deployer);
- }
- }
-
- @Test
- public void cannotDeployWarTwice() throws Exception {
- StandaloneDeployer deployer = null;
- try {
- File warFile = getWarFile("minimalistic.war");
- deployer = new StandaloneDeployer(HOST, MGMT_PORT);
- deployer.addWar(warFile).deploy();
- deployer.addWar(warFile).deploy();
- } finally {
- quietlyCleanup(deployer);
- }
- }
-
- private File getWarFile(String name) throws URISyntaxException, IOException {
- Bundle bundle = Platform.getBundle(BUNDLE_ID);
- URL entryUrl = bundle.getEntry(WAR_FOLDER + name);
- return new File(FileLocator.resolve(entryUrl).toURI());
- }
-
- private String getServerResponse(URL url) throws IOException {
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setUseCaches(false);
- connection.setDoInput(true);
- connection.setAllowUserInteraction(false);
- connection.setConnectTimeout(WEBAPP_RESPONSE_TIMEOUT);
- connection.setInstanceFollowRedirects(true);
- connection.setDoOutput(false);
- BufferedInputStream in = new BufferedInputStream(connection.getInputStream());
- return toString(in);
- }
-
- private String toString(InputStream in) throws IOException {
- StringWriter writer = new StringWriter();
- for (int data = -1; ((data = in.read()) != -1);) {
- writer.write(data);
- }
- return writer.toString();
- }
-
- private void quietlyCleanup(StandaloneDeployer deployer) {
- try {
- if (deployer != null) {
- deployer.undeploy();
- deployer.dispose();
- }
- } catch (Exception e) {
- // ignore
- }
-
- }
-}
Copied: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java (from rev 30534, workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneDeployerIntegrationTest.java)
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java (rev 0)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java 2011-04-13 09:11:43 UTC (rev 30547)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.ide.eclipse.as7.deployment.tests;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.ide.eclipse.as7.deployment.DeployerException;
+import org.jboss.ide.eclipse.as7.deployment.StandaloneOperations;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class StandaloneOperationsIntegrationTest {
+
+ private static final String WAR_FOLDER = "/wars/";
+ private static final String BUNDLE_ID = "org.jboss.ide.eclipse.as7.deployment.tests";
+
+ private static final int WEBAPP_RESPONSE_TIMEOUT = 10 * 1024;
+
+ private static final String HOST = "localhost";
+ private static final int MGMT_PORT = 9999;
+ private static final int WEB_PORT = 8080;
+
+ @Test
+ public void canDeploy() throws Exception {
+ StandaloneOperations deployer = null;
+ File warFile = getWarFile("minimalistic.war");
+ try {
+ deployer = new StandaloneOperations(HOST, MGMT_PORT);
+ quietlyUndeploy(warFile, deployer); // make sure doesn't
+ // exist
+ deployer.deploy(warFile).execute();
+
+ String response = getServerResponse(new URL(
+ MessageFormat.format(
+ "http://{0}:{1}/{2}", HOST, String.valueOf(WEB_PORT), "minimalistic")));
+ assertTrue(response.indexOf("minimalistic") >= 0);
+
+ } finally {
+ quietlyUndeploy(warFile, deployer);
+ }
+ }
+
+ @Test(expected = DeployerException.class)
+ public void cannotDeployWarTwice() throws Exception {
+ StandaloneOperations deployer = null;
+ File warFile = getWarFile("minimalistic.war");
+ try {
+ deployer = new StandaloneOperations(HOST, MGMT_PORT);
+ deployer.deploy(warFile).execute();
+ deployer.deploy(warFile).execute();
+ } finally {
+ quietlyUndeploy(warFile, deployer);
+ }
+ }
+
+ private File getWarFile(String name) throws URISyntaxException, IOException {
+ Bundle bundle = Platform.getBundle(BUNDLE_ID);
+ URL entryUrl = bundle.getEntry(WAR_FOLDER + name);
+ return new File(FileLocator.resolve(entryUrl).toURI());
+ }
+
+ private String getServerResponse(URL url) throws IOException {
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setUseCaches(false);
+ connection.setDoInput(true);
+ connection.setAllowUserInteraction(false);
+ connection.setConnectTimeout(WEBAPP_RESPONSE_TIMEOUT);
+ connection.setInstanceFollowRedirects(true);
+ connection.setDoOutput(false);
+ BufferedInputStream in = new BufferedInputStream(connection.getInputStream());
+ return toString(in);
+ }
+
+ private String toString(InputStream in) throws IOException {
+ StringWriter writer = new StringWriter();
+ for (int data = -1; ((data = in.read()) != -1);) {
+ writer.write(data);
+ }
+ return writer.toString();
+ }
+
+ private void quietlyUndeploy(File file, StandaloneOperations deployer) {
+ try {
+ if (deployer != null) {
+ deployer.undeploy(file);
+ deployer.dispose();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ // ignore
+ }
+ }
+}
Property changes on: workspace/adietish/org.jboss.ide.eclipse.as7.deployment.tests/src/org/jboss/ide/eclipse/as7/deployment/tests/StandaloneOperationsIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r30546 - in trunk/module_template/docs/reference/en-US: images/reference and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-04-12 23:47:54 -0400 (Tue, 12 Apr 2011)
New Revision: 30546
Added:
trunk/module_template/docs/reference/en-US/images/reference/view_one/
trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_four_name.png
trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_one_name.png
trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_three_name.png
trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_two_name.png
trunk/module_template/docs/reference/en-US/images/reference/view_one/view_screenshot_one.png
Modified:
trunk/module_template/docs/reference/en-US/Template.xml
trunk/module_template/docs/reference/en-US/reference.xml
Log:
updated with template for views
Modified: trunk/module_template/docs/reference/en-US/Template.xml
===================================================================
--- trunk/module_template/docs/reference/en-US/Template.xml 2011-04-13 00:06:42 UTC (rev 30545)
+++ trunk/module_template/docs/reference/en-US/Template.xml 2011-04-13 03:47:54 UTC (rev 30546)
@@ -13,3 +13,7 @@
<xi:include href="revision_history.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
+ <!--
+ Be sure to read and look at the Docbook XML for the 'Documentation Conventions' book; this will show you which callout tags are acceptable, how to correctly use programlistings etc...
+ https://svn.jboss.org/repos/jbosstools/trunk/documentation/guides/Documen...
+ -->
Added: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_four_name.png
===================================================================
(Binary files differ)
Property changes on: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_four_name.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_one_name.png
===================================================================
(Binary files differ)
Property changes on: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_one_name.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_three_name.png
===================================================================
(Binary files differ)
Property changes on: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_three_name.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_two_name.png
===================================================================
(Binary files differ)
Property changes on: trunk/module_template/docs/reference/en-US/images/reference/view_one/icon-icon_two_name.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/module_template/docs/reference/en-US/images/reference/view_one/view_screenshot_one.png
===================================================================
(Binary files differ)
Property changes on: trunk/module_template/docs/reference/en-US/images/reference/view_one/view_screenshot_one.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/module_template/docs/reference/en-US/reference.xml
===================================================================
--- trunk/module_template/docs/reference/en-US/reference.xml 2011-04-13 00:06:42 UTC (rev 30545)
+++ trunk/module_template/docs/reference/en-US/reference.xml 2011-04-13 03:47:54 UTC (rev 30546)
@@ -66,8 +66,109 @@
<section id="sect-template-reference-views-view_one">
<title>View one</title>
<para>
- Placeholder text
- </para>
+ The <guilabel>Web Projects</guilabel> view presents each web project in a format suitable for navigating through the various attributes of a typical web project such as <guilabel>Tag Libraries</guilabel> and <guilabel>web.xml</guilabel> properties.
+ </para>
+ <figure id="figure-JBT_WebPerspective_WebProjectsView">
+ <title>Web Development Perspective - Web Projects View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/view_one/view_screenshot_one.png" format="PNG"/>
+ </imageobject>
+ <textobject>
+ <para>Web Projects View</para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <table id="table-template-reference-views-view_one_table" frame='all'>
+ <title>Web Development Perspective - Web Projects View</title>
+ <tgroup cols='3' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1' colwidth="1*"/>
+ <colspec colname='c2' colwidth="1*"/>
+ <colspec colname='c3' colwidth="3*"/>
+ <thead>
+ <row>
+ <entry>Icon</entry>
+ <entry>Action</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/view_one/icon-icon_one_name.png" format="PNG"/>
+ </imageobject>
+ <textobject>
+ <para>New JSF Project Icon</para>
+ </textobject>
+ </mediaobject>
+ </entry>
+ <entry>
+ <guilabel>Create New JSF Project</guilabel>
+ </entry>
+ <entry>
+ Describe what will happen upon clicking this button. If a Task is available relating to this button, use an xref tag to link to the Task.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/view_one/icon-icon_two_name.png" format="PNG"/>
+ </imageobject>
+ <textobject>
+ <para>Import JSF Project Icon</para>
+ </textobject>
+ </mediaobject>
+ </entry>
+ <entry>
+ <guilabel>Import JSF Project</guilabel>
+ </entry>
+ <entry>
+ Describe what will happen upon clicking this button. If a Task is available relating to this button, use an xref tag to link to the Task.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/view_one/icon-icon_three_name.png" format="PNG"/>
+ </imageobject>
+ <textobject>
+ <para>Create New Struts Project Icon</para>
+ </textobject>
+ </mediaobject>
+ </entry>
+ <entry>
+ <guilabel>Create New Struts Project</guilabel>
+ </entry>
+ <entry>
+ Describe what will happen upon clicking this button. If a Task is available relating to this button, use an xref tag to link to the Task.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/reference/view_one/icon-icon_four_name.png" format="PNG"/>
+ </imageobject>
+ <textobject>
+ <para>Import Struts Project Icon</para>
+ </textobject>
+ </mediaobject>
+ </entry>
+ <entry>
+ <guilabel>Import Struts Project</guilabel>
+ </entry>
+ <entry>
+ Describe what will happen upon clicking this button. If a Task is available relating to this button, use an xref tag to link to the Task.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</section>
<section id="sect-template-reference-views-view_two">
<title>View two</title>
@@ -77,7 +178,7 @@
</section>
</section>
<section id="sect-template-reference-editors">
- <title>Views</title>
+ <title>Editors</title>
<para>
Explain what an editor is in one paragraph
</para>
13 years, 7 months
JBoss Tools SVN: r30545 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test: projects/CDISolderTest/src/org/jboss/service and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-12 20:06:42 -0400 (Tue, 12 Apr 2011)
New Revision: 30545
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/QueryService.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserListManager.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserQuery.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java
Log:
JBIDE-8717
https://issues.jboss.org/browse/JBIDE-8717
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/QueryService.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/QueryService.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/QueryService.java 2011-04-13 00:06:42 UTC (rev 30545)
@@ -0,0 +1,10 @@
+package org.jboss.service;
+
+import java.util.List;
+
+import org.jboss.seam.solder.serviceHandler.ServiceHandlerType;
+
+(a)ServiceHandlerType(List.class)
+public @interface QueryService {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/QueryService.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserListManager.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserListManager.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserListManager.java 2011-04-13 00:06:42 UTC (rev 30545)
@@ -0,0 +1,7 @@
+package org.jboss.service;
+
+import javax.inject.Inject;
+
+public class UserListManager {
+ @Inject UserQuery userQuery;
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserListManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserQuery.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserQuery.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserQuery.java 2011-04-13 00:06:42 UTC (rev 30545)
@@ -0,0 +1,6 @@
+package org.jboss.service;
+
+@QueryService
+public interface UserQuery {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/src/org/jboss/service/UserQuery.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java 2011-04-12 23:56:26 UTC (rev 30544)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java 2011-04-13 00:06:42 UTC (rev 30545)
@@ -29,6 +29,7 @@
suiteAll.addTestSuite(VetoTest.class);
suiteAll.addTestSuite(ExactTest.class);
suiteAll.addTestSuite(MessageLoggerTest.class);
+ suiteAll.addTestSuite(ServiceHandlerTest.class);
SeamSolderTestSetup suite = new SeamSolderTestSetup(suiteAll);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java 2011-04-12 23:56:26 UTC (rev 30544)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java 2011-04-13 00:06:42 UTC (rev 30545)
@@ -29,7 +29,6 @@
*
*/
public class ExactTest extends SeamSolderTest {
- protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.solder.core.test";
public ExactTest() {}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java 2011-04-12 23:56:26 UTC (rev 30544)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java 2011-04-13 00:06:42 UTC (rev 30545)
@@ -14,6 +14,7 @@
import junit.framework.Test;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
@@ -22,7 +23,7 @@
*/
public class SeamSolderTestSetup extends TestSetup {
- protected IProject tckProject;
+ protected IProject project;
public SeamSolderTestSetup(Test test) {
super(test);
@@ -30,14 +31,17 @@
@Override
protected void setUp() throws Exception {
- tckProject = ResourcesUtils.importProject(SeamSolderTest.PLUGIN_ID, SeamSolderTest.PROJECT_PATH);
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(SeamSolderTest.PROJECT_NAME);
+ if(project == null || !project.exists()) {
+ project = ResourcesUtils.importProject(SeamSolderTest.PLUGIN_ID, SeamSolderTest.PROJECT_PATH);
+ }
}
@Override
protected void tearDown() throws Exception {
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
JobUtils.waitForIdle();
- tckProject.delete(true, true, null);
+ project.delete(true, true, null);
JobUtils.waitForIdle();
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java 2011-04-13 00:06:42 UTC (rev 30545)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.solder.core.test;
+
+import java.io.IOException;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.IProducerMethod;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class ServiceHandlerTest extends SeamSolderTest {
+
+ public ServiceHandlerTest() {}
+
+ public void testMessageLogger() throws CoreException, IOException {
+ ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
+
+ IInjectionPointField logger = getInjectionPointField(cdi, "src/org/jboss/service/UserListManager.java", "userQuery");
+
+ Set<IBean> bs = cdi.getBeans(false, logger);
+ assertEquals(1, bs.size());
+
+ IBean b = bs.iterator().next();
+
+ IType t = b.getBeanClass();
+ assertNotNull(t);
+ assertTrue(t.isInterface());
+ assertEquals("org.jboss.service.UserQuery", t.getFullyQualifiedName());
+
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r30544 - trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-12 19:56:26 -0400 (Tue, 12 Apr 2011)
New Revision: 30544
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java
Log:
JBIDE-8717
https://issues.jboss.org/browse/JBIDE-8717
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java 2011-04-12 23:54:50 UTC (rev 30543)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java 2011-04-12 23:56:26 UTC (rev 30544)
@@ -13,12 +13,7 @@
import java.io.IOException;
import java.util.Set;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
@@ -28,27 +23,16 @@
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IProducerMethod;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ResourcesUtils;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class BeanNamingTest extends TestCase {
- protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.solder.core.test";
- IProject project = null;
+public class BeanNamingTest extends SeamSolderTest {
public BeanNamingTest() {}
- public void setUp() throws Exception {
- project = ResourcesUtils.importProject(PLUGIN_ID, "/projects/CDISolderTest");
- JobUtils.waitForIdle();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
- }
-
public void testNamedPackage() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
@@ -187,12 +171,4 @@
}
- public void tearDown() throws Exception {
- boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- JobUtils.waitForIdle();
- project.delete(true, true, null);
- JobUtils.waitForIdle();
- ResourcesUtils.setBuildAutomatically(saveAutoBuild);
- JobUtils.waitForIdle();
- }
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java 2011-04-12 23:54:50 UTC (rev 30543)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/CDISeamSolderCoreAllTests.java 2011-04-12 23:56:26 UTC (rev 30544)
@@ -30,6 +30,8 @@
suiteAll.addTestSuite(ExactTest.class);
suiteAll.addTestSuite(MessageLoggerTest.class);
- return suiteAll;
+ SeamSolderTestSetup suite = new SeamSolderTestSetup(suiteAll);
+
+ return suite;
}
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java 2011-04-12 23:54:50 UTC (rev 30543)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java 2011-04-12 23:56:26 UTC (rev 30544)
@@ -1,47 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core.test;
-
import java.io.IOException;
import java.util.Set;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IMember;
-import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IProducerMethod;
-import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ResourcesUtils;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class ExactTest extends TestCase {
+public class ExactTest extends SeamSolderTest {
protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.solder.core.test";
- IProject project = null;
public ExactTest() {}
- public void setUp() throws Exception {
- project = ResourcesUtils.importProject(PLUGIN_ID, "/projects/CDISolderTest");
- JobUtils.waitForIdle();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
- }
-
public void testExact() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
@@ -84,12 +75,4 @@
assertEquals(3, count);
}
- public void tearDown() throws Exception {
- boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- JobUtils.waitForIdle();
- project.delete(true, true, null);
- JobUtils.waitForIdle();
- ResourcesUtils.setBuildAutomatically(saveAutoBuild);
- JobUtils.waitForIdle();
- }
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java 2011-04-12 23:54:50 UTC (rev 30543)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java 2011-04-12 23:56:26 UTC (rev 30544)
@@ -13,40 +13,22 @@
import java.io.IOException;
import java.util.Set;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
-import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInjectionPointField;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ResourcesUtils;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class MessageLoggerTest extends TestCase {
- protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.solder.core.test";
- IProject project = null;
+public class MessageLoggerTest extends SeamSolderTest {
public MessageLoggerTest() {}
- public void setUp() throws Exception {
- project = ResourcesUtils.importProject(PLUGIN_ID, "/projects/CDISolderTest");
- JobUtils.waitForIdle();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
- }
-
public void testMessageLogger() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
@@ -81,30 +63,4 @@
}
- public void tearDown() throws Exception {
- boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- JobUtils.waitForIdle();
- project.delete(true, true, null);
- JobUtils.waitForIdle();
- ResourcesUtils.setBuildAutomatically(saveAutoBuild);
- JobUtils.waitForIdle();
- }
-
- protected IInjectionPointField getInjectionPointField(ICDIProject cdi, String beanClassFilePath, String fieldName) {
- IFile file = cdi.getNature().getProject().getFile(beanClassFilePath);
- Set<IBean> beans = cdi.getBeans(file.getFullPath());
- assertEquals("Wrong number of the beans", 1, beans.size());
- Set<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
- for (IInjectionPoint injectionPoint : injections) {
- if(injectionPoint instanceof IInjectionPointField) {
- IInjectionPointField field = (IInjectionPointField)injectionPoint;
- if(fieldName.equals(field.getField().getElementName())) {
- return field;
- }
- }
- }
- fail("Can't find \"" + fieldName + "\" injection point filed in " + beanClassFilePath);
- return null;
- }
-
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTest.java 2011-04-12 23:56:26 UTC (rev 30544)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.solder.core.test;
+
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SeamSolderTest extends TestCase {
+ protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.solder.core.test";
+ protected static String PROJECT_NAME = "CDISolderTest";
+ protected static String PROJECT_PATH = "/projects/CDISolderTest";
+
+ protected IProject project;
+ protected ICDIProject cdiProject;
+
+ public SeamSolderTest() {
+ project = getTestProject();
+ cdiProject = CDICorePlugin.getCDIProject(project, false);
+ }
+
+ public IProject getTestProject() {
+ if(project==null) {
+ try {
+ project = findTestProject();
+ if(project==null || !project.exists()) {
+ project = ResourcesUtils.importProject(PLUGIN_ID, PROJECT_PATH);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Can't import CDI test project: " + e.getMessage());
+ }
+ }
+ return project;
+ }
+
+ public static IProject findTestProject() {
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ }
+
+ protected IInjectionPointField getInjectionPointField(ICDIProject cdi, String beanClassFilePath, String fieldName) {
+ IFile file = cdi.getNature().getProject().getFile(beanClassFilePath);
+ Set<IBean> beans = cdi.getBeans(file.getFullPath());
+ assertEquals("Wrong number of the beans", 1, beans.size());
+ Set<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
+ for (IInjectionPoint injectionPoint : injections) {
+ if(injectionPoint instanceof IInjectionPointField) {
+ IInjectionPointField field = (IInjectionPointField)injectionPoint;
+ if(fieldName.equals(field.getField().getElementName())) {
+ return field;
+ }
+ }
+ }
+ fail("Can't find \"" + fieldName + "\" injection point filed in " + beanClassFilePath);
+ return null;
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java 2011-04-12 23:56:26 UTC (rev 30544)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.solder.core.test;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class SeamSolderTestSetup extends TestSetup {
+
+ protected IProject tckProject;
+
+ public SeamSolderTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ tckProject = ResourcesUtils.importProject(SeamSolderTest.PLUGIN_ID, SeamSolderTest.PROJECT_PATH);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
+ tckProject.delete(true, true, null);
+ JobUtils.waitForIdle();
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/SeamSolderTestSetup.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java 2011-04-12 23:54:50 UTC (rev 30543)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java 2011-04-12 23:56:26 UTC (rev 30544)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core.test;
@@ -4,40 +14,23 @@
import java.io.IOException;
import java.util.Set;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ResourcesUtils;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class VetoTest extends TestCase {
- protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.solder.core.test";
- IProject project = null;
+public class VetoTest extends SeamSolderTest {
public VetoTest() {}
- public void setUp() throws Exception {
- project = ResourcesUtils.importProject(PLUGIN_ID, "/projects/CDISolderTest");
- JobUtils.waitForIdle();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
- }
-
public void testVeto() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
@@ -103,12 +96,4 @@
}
- public void tearDown() throws Exception {
- boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- JobUtils.waitForIdle();
- project.delete(true, true, null);
- JobUtils.waitForIdle();
- ResourcesUtils.setBuildAutomatically(saveAutoBuild);
- JobUtils.waitForIdle();
- }
}
13 years, 7 months
JBoss Tools SVN: r30543 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core: src/org/jboss/tools/cdi/seam/solder/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-12 19:54:50 -0400 (Tue, 12 Apr 2011)
New Revision: 30543
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServiceHandlerExtension.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderLoggerExtension.java
Log:
JBIDE-8717
https://issues.jboss.org/browse/JBIDE-8717
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml 2011-04-12 23:53:00 UTC (rev 30542)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/plugin.xml 2011-04-12 23:54:50 UTC (rev 30543)
@@ -11,5 +11,10 @@
class="org.jboss.tools.cdi.seam.solder.core.CDISeamSolderLoggerExtension"
runtime="org.jboss.seam.solder.logging.TypedMessageLoggerExtension">
</cdiextension>
+
+ <cdiextension
+ class="org.jboss.tools.cdi.seam.solder.core.CDISeamSolderServiceHandlerExtension"
+ runtime="org.jboss.seam.solder.serviceHandler.ServiceHandlerExtension">
+ </cdiextension>
</extension>
</plugin>
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants.java 2011-04-12 23:53:00 UTC (rev 30542)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderConstants.java 2011-04-12 23:54:50 UTC (rev 30543)
@@ -11,4 +11,7 @@
public String MESSAGE_LOGGER_ANNOTATION_TYPE_NAME = "org.jboss.seam.solder.logging.MessageLogger";
public String MESSAGE_BUNDLE_ANNOTATION_TYPE_NAME = "org.jboss.seam.solder.messages.MessageBundle";
+ public String SERVICE_HANDLER_TYPE_ANNOTATION_TYPE_NAME = "org.jboss.seam.solder.serviceHandler.ServiceHandlerType";
+ public String SERVICE_ANNOTATION_KIND = "serviceAnnotation";
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderLoggerExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderLoggerExtension.java 2011-04-12 23:53:00 UTC (rev 30542)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderLoggerExtension.java 2011-04-12 23:54:50 UTC (rev 30543)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core;
import java.util.HashMap;
@@ -10,8 +20,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.SourceRange;
import org.jboss.tools.cdi.core.CDICoreNature;
-import org.jboss.tools.cdi.core.IAnnotationDeclaration;
-import org.jboss.tools.cdi.core.IRootDefinitionContext;
+import org.jboss.tools.cdi.core.extension.AbstractDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.ICDIExtension;
import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
@@ -24,6 +33,11 @@
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
import org.jboss.tools.common.model.XModelObject;
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
public class CDISeamSolderLoggerExtension implements ICDIExtension, IBuildParticipantFeature {
CDICoreNature project;
LoggerDefinitionContext context = new LoggerDefinitionContext();
@@ -53,7 +67,7 @@
}
public void buildDefinitions(FileSet fileSet) {
- LoggerDefinitionContext workingCopy = context.getWorkingCopy();
+ LoggerDefinitionContext workingCopy = (LoggerDefinitionContext)context.getWorkingCopy();
Map<IPath, Set<IType>> is = fileSet.getInterfaces();
for (IPath path: is.keySet()) {
@@ -86,7 +100,7 @@
public void buildBeans() {
CDIProject p = ((CDIProject)project.getDelegate());
- Map<IPath, TypeDefinition> loggers = context.getMessageLoggers();
+ Map<String, TypeDefinition> loggers = context.getMessageLoggers();
for (TypeDefinition d: loggers.values()) {
ClassBean b = new ClassBean();
b.setDefinition(d);
@@ -94,7 +108,7 @@
p.addBean(b);
}
- Map<IPath, TypeDefinition> bundles = context.getMessageBundles();
+ Map<String, TypeDefinition> bundles = context.getMessageBundles();
for (TypeDefinition d: bundles.values()) {
ClassBean b = new ClassBean();
b.setDefinition(d);
@@ -104,16 +118,12 @@
}
- class LoggerDefinitionContext implements IDefinitionContextExtension {
- IRootDefinitionContext root;
-
- Map<IPath, TypeDefinition> messageLoggers = new HashMap<IPath, TypeDefinition>();
- Map<IPath, TypeDefinition> messageBundles = new HashMap<IPath, TypeDefinition>();
+ class LoggerDefinitionContext extends AbstractDefinitionContextExtension {
+ Map<String, TypeDefinition> messageLoggers = new HashMap<String, TypeDefinition>();
+ Map<String, TypeDefinition> messageBundles = new HashMap<String, TypeDefinition>();
- LoggerDefinitionContext original;
- LoggerDefinitionContext workingCopy;
- private LoggerDefinitionContext copy(boolean clean) {
+ protected LoggerDefinitionContext copy(boolean clean) {
LoggerDefinitionContext copy = new LoggerDefinitionContext();
copy.root = root;
if(!clean) {
@@ -124,71 +134,41 @@
return copy;
}
- public void newWorkingCopy(boolean forFullBuild) {
- if(original != null) return;
- workingCopy = copy(forFullBuild);
- workingCopy.original = this;
+ protected void doApplyWorkingCopy() {
+ messageLoggers = ((LoggerDefinitionContext)workingCopy).messageLoggers;
+ messageBundles = ((LoggerDefinitionContext)workingCopy).messageBundles;
}
- public void applyWorkingCopy() {
- if(original != null) {
- original.applyWorkingCopy();
- return;
- }
- if(workingCopy == null) {
- return;
- }
- messageLoggers = workingCopy.messageLoggers;
- messageBundles = workingCopy.messageBundles;
-
- workingCopy = null;
- }
-
public void clean() {
messageLoggers.clear();
messageBundles.clear();
}
public void clean(IPath path) {
- messageLoggers.remove(path);
- messageBundles.remove(path);
}
- public void setRootContext(IRootDefinitionContext context) {
- root = context;
+ public void clean(String typeName) {
+ messageLoggers.remove(typeName);
+ messageBundles.remove(typeName);
}
- public IRootDefinitionContext getRootContext() {
- return root;
- }
-
- public LoggerDefinitionContext getWorkingCopy() {
- if(original != null) {
- return this;
- }
- if(workingCopy != null) {
- return workingCopy;
- }
- workingCopy = copy(false);
- workingCopy.original = this;
- return workingCopy;
- }
-
public void addMessageLogger(IPath path, TypeDefinition def) {
- messageLoggers.put(path, def);
- root.addToParents(path);
+ String typeName = def.getType().getFullyQualifiedName();
+ messageLoggers.put(typeName, def);
+ root.addType(path, typeName);
}
public void addMessageBundle(IPath path, TypeDefinition def) {
- messageBundles.put(path, def);
- root.addToParents(path);
+ String typeName = def.getType().getFullyQualifiedName();
+ messageBundles.put(typeName, def);
+ root.addType(path, typeName);
}
- public Map<IPath, TypeDefinition> getMessageLoggers() {
+ public Map<String, TypeDefinition> getMessageLoggers() {
return messageLoggers;
}
- public Map<IPath, TypeDefinition> getMessageBundles() {
+ public Map<String, TypeDefinition> getMessageBundles() {
return messageBundles;
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServiceHandlerExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServiceHandlerExtension.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServiceHandlerExtension.java 2011-04-12 23:54:50 UTC (rev 30543)
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.solder.core;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.extension.AbstractDefinitionContextExtension;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
+import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
+import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.cdi.internal.core.impl.ClassBean;
+import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+import org.jboss.tools.cdi.internal.core.scanner.FileSet;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class CDISeamSolderServiceHandlerExtension implements ICDIExtension, IBuildParticipantFeature {
+ CDICoreNature project;
+ ServiceHandlerDefinitionContext context = new ServiceHandlerDefinitionContext();
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public void setProject(CDICoreNature n) {
+ project = n;
+ }
+
+ public IDefinitionContextExtension getContext() {
+ return context;
+ }
+
+ public void beginVisiting() {
+ }
+
+ public void visitJar(IPath path, IPackageFragmentRoot root, XModelObject beansXML) {
+ }
+
+ public void visit(IFile file, IPath src, IPath webinf) {
+ }
+
+ public void buildDefinitions() {
+ }
+
+ public void buildDefinitions(FileSet fileSet) {
+ ServiceHandlerDefinitionContext workingCopy = (ServiceHandlerDefinitionContext)context.getWorkingCopy();
+
+ Map<IPath, Set<IType>> is = fileSet.getInterfaces();
+ for (IPath path: is.keySet()) {
+ Set<IType> ts = is.get(path);
+ for (IType t: ts) {
+ InterfaceDefinition i = new InterfaceDefinition(t);
+ List<IAnnotationDeclaration> as = i.getAnnotations();
+ for (IAnnotationDeclaration a: as) {
+ if(workingCopy.isServiceAnnotation(a.getType())) {
+ TypeDefinition d = new TypeDefinition();
+ d.setType(t, workingCopy.getRootContext());
+ workingCopy.addService(path, d);
+ }
+ }
+ }
+ }
+ }
+
+ public void buildBeans() {
+ CDIProject p = ((CDIProject)project.getDelegate());
+ Map<String, TypeDefinition> services = context.getServices();
+ for (TypeDefinition d: services.values()) {
+ ClassBean b = new ClassBean();
+ b.setDefinition(d);
+ b.setParent(p);
+ p.addBean(b);
+ }
+
+ }
+
+ class ServiceHandlerDefinitionContext extends AbstractDefinitionContextExtension {
+ Set<String> serviceAnnotations = new HashSet<String>();
+ Map<String, TypeDefinition> services = new HashMap<String, TypeDefinition>();
+
+
+ protected ServiceHandlerDefinitionContext copy(boolean clean) {
+ ServiceHandlerDefinitionContext copy = new ServiceHandlerDefinitionContext();
+ copy.root = root;
+ if(!clean) {
+ copy.services.putAll(services);
+ copy.serviceAnnotations.addAll(serviceAnnotations);
+ }
+
+ return copy;
+ }
+
+ protected void doApplyWorkingCopy() {
+ services = ((ServiceHandlerDefinitionContext)workingCopy).services;
+ serviceAnnotations = ((ServiceHandlerDefinitionContext)workingCopy).serviceAnnotations;
+ }
+
+
+ public void clean() {
+ services.clear();
+ serviceAnnotations.clear();
+ }
+
+ public void clean(String typeName) {
+ services.remove(typeName);
+ serviceAnnotations.remove(typeName);
+ }
+
+ public void addService(IPath path, TypeDefinition def) {
+ String typeName = def.getType().getFullyQualifiedName();
+ services.put(typeName, def);
+ root.addType(path, typeName);
+ }
+
+ public Map<String, TypeDefinition> getServices() {
+ return services;
+ }
+
+ public void computeAnnotationKind(AnnotationDefinition annotation) {
+ if(annotation.isAnnotationPresent(CDISeamSolderConstants.SERVICE_HANDLER_TYPE_ANNOTATION_TYPE_NAME)) {
+ annotation.setExtendedKind(CDISeamSolderConstants.SERVICE_ANNOTATION_KIND);
+ serviceAnnotations.add(annotation.getType().getFullyQualifiedName());
+ }
+ }
+
+ public boolean isServiceAnnotation(IType type) {
+ return (type != null && serviceAnnotations.contains(type.getFullyQualifiedName()));
+ }
+
+ }
+
+ class InterfaceDefinition extends AbstractMemberDefinition {
+ InterfaceDefinition(IType type) {
+ setAnnotatable(type, type, context.getRootContext());
+ }
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderServiceHandlerExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r30542 - trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-12 19:53:00 -0400 (Tue, 12 Apr 2011)
New Revision: 30542
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
Log:
JBIDE-8717
https://issues.jboss.org/browse/JBIDE-8717
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2011-04-12 23:51:35 UTC (rev 30541)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2011-04-12 23:53:00 UTC (rev 30542)
@@ -16,8 +16,7 @@
import java.util.Set;
import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.cdi.core.IRootDefinitionContext;
-import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
+import org.jboss.tools.cdi.core.extension.AbstractDefinitionContextExtension;
import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
/**
@@ -25,16 +24,15 @@
* @author Viacheslav Kabanovich
*
*/
-public class ConfigDefinitionContext implements IDefinitionContextExtension {
- IRootDefinitionContext root;
-
+public class ConfigDefinitionContext extends AbstractDefinitionContextExtension {
private Map<IPath, SeamBeansDefinition> beanXMLs = new HashMap<IPath, SeamBeansDefinition>();
private Map<IPath, SeamBeansDefinition> seambeanXMLs = new HashMap<IPath, SeamBeansDefinition>();
- ConfigDefinitionContext workingCopy;
- ConfigDefinitionContext original;
+ public ConfigDefinitionContext getWorkingCopy() {
+ return (ConfigDefinitionContext)super.getWorkingCopy();
+ }
- private ConfigDefinitionContext copy(boolean clean) {
+ protected ConfigDefinitionContext copy(boolean clean) {
ConfigDefinitionContext copy = new ConfigDefinitionContext();
copy.root = root;
if(!clean) {
@@ -46,27 +44,11 @@
return copy;
}
- public void newWorkingCopy(boolean forFullBuild) {
- if(original != null) return;
- workingCopy = copy(forFullBuild);
- workingCopy.original = this;
+ protected void doApplyWorkingCopy() {
+ beanXMLs = ((ConfigDefinitionContext)workingCopy).beanXMLs;
+ seambeanXMLs = ((ConfigDefinitionContext)workingCopy).seambeanXMLs;
}
- public void applyWorkingCopy() {
- if(original != null) {
- original.applyWorkingCopy();
- return;
- }
- if(workingCopy == null) {
- return;
- }
-
- beanXMLs = workingCopy.beanXMLs;
- seambeanXMLs = workingCopy.seambeanXMLs;
-
- workingCopy = null;
- }
-
public void clean() {
synchronized (beanXMLs) {
beanXMLs.clear();
@@ -85,26 +67,6 @@
}
}
- public void setRootContext(IRootDefinitionContext context) {
- root = context;
- }
-
- public IRootDefinitionContext getRootContext() {
- return root;
- }
-
- public ConfigDefinitionContext getWorkingCopy() {
- if(original != null) {
- return this;
- }
- if(workingCopy != null) {
- return workingCopy;
- }
- workingCopy = copy(false);
- workingCopy.original = this;
- return workingCopy;
- }
-
public void addBeanXML(IPath path, SeamBeansDefinition def) {
synchronized (beanXMLs) {
beanXMLs.put(path, def);
13 years, 7 months