You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/01/04 14:22:42 UTC
svn commit: r1227144 [14/18] - in /karaf/eik/trunk: ./ features/
features/info.evanchik.eclipse.karaf.feature/
features/info.evanchik.eclipse.karaf.jmx.feature/
features/info.evanchik.eclipse.karaf.update/
features/info.evanchik.eclipse.karaf.update/fe...
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServer.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServer.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServer.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServer.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.core.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class KarafServer extends ServerDelegate {
+
+ public KarafServer() {
+ super();
+ }
+
+ /**
+ * Determines whether or not the list of modules can be added and removed
+ * from this server instance. A value of {@link Status#OK_STATUS} is
+ * returned if the operation succeeds.
+ *
+ * @param add
+ * List of {@link IModule}S to be added to this server
+ * @param remove
+ * List of {@link IModule}S to be removed from this server
+ * @return {@Status#OK_STATUS} if the additions/removals
+ * are successful, {@link IStatus.ERROR} otherwise
+ */
+ @Override
+ public IStatus canModifyModules(final IModule[] add, final IModule[] remove) {
+ if (add != null) {
+
+ }
+
+ if (remove != null) {
+
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ public IModule[] getChildModules(final IModule[] module) {
+ return null;
+ }
+
+ @Override
+ public IModule[] getRootModules(final IModule module) throws CoreException {
+ return new IModule[] { module };
+ }
+
+ /**
+ * Performs the actual modification to the server by adding and/or removing
+ * modules.
+ */
+ @Override
+ public void modifyModules(final IModule[] add, final IModule[] remove, final IProgressMonitor monitor) throws CoreException {
+ final IStatus status = canModifyModules(add, remove);
+ if (status == null || !status.isOK()) {
+ throw new CoreException(status);
+ }
+
+ if (add != null) {
+
+ }
+
+ if (remove != null) {
+
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "KarafServer"; //$NON-NLS-1$
+ }
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerBehavior.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerBehavior.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerBehavior.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerBehavior.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,241 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.core.server;
+
+import info.evanchik.eclipse.karaf.workbench.MBeanProvider;
+import info.evanchik.eclipse.karaf.wtp.core.KarafServerLaunchConfigurationInitializer;
+import info.evanchik.eclipse.karaf.wtp.core.KarafWtpPluginActivator;
+
+import java.io.IOException;
+
+import javax.management.ObjectName;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.jmx.framework.FrameworkMBean;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class KarafServerBehavior extends ServerBehaviourDelegate {
+
+ /**
+ *
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+ private final class MBeanProviderServiceTracker implements ServiceTrackerCustomizer {
+
+ private final ServiceTracker serviceTracker;
+
+ public MBeanProviderServiceTracker() {
+ final BundleContext context = KarafWtpPluginActivator.getDefault().getBundle().getBundleContext();
+ serviceTracker = new ServiceTracker(context, MBeanProvider.class.getName(), this);
+ serviceTracker.open();
+ }
+
+ /**
+ * Adds the {@link MBeanProvider} service to this server instance. This
+ * service is how the workbench interacts with the running server. It
+ * also serves as a sentry that indicates the server is operational.
+ *
+ * @param reference
+ */
+ @Override
+ public Object addingService(final ServiceReference reference) {
+ final String serviceMemento = (String) reference.getProperty(MBeanProvider.KARAF_WORKBENCH_SERVICES_ID);
+
+ if (serviceMemento.equals(memento)) {
+ final Object o = reference.getBundle().getBundleContext().getService(reference);
+
+ setServerState(IServer.STATE_STARTED);
+
+ mbeanProvider = (MBeanProvider) o;
+
+ return o;
+ }
+
+ return null;
+ }
+
+ public void close() {
+ serviceTracker.close();
+ }
+
+ @Override
+ public void modifiedService(final ServiceReference reference, final Object service) {
+ }
+
+ @Override
+ public void removedService(final ServiceReference reference, final Object service) {
+ final String serviceMemento = (String) reference.getProperty(MBeanProvider.KARAF_WORKBENCH_SERVICES_ID);
+
+ if (serviceMemento.equals(memento)) {
+ mbeanProvider = null;
+
+ terminate();
+ }
+ }
+ }
+
+ private static final ObjectName FRAMEWORK;
+
+ static {
+ /*
+ * If this throws an exception we're in trouble because it means that the
+ * constants are invalid
+ */
+ try {
+ FRAMEWORK = new ObjectName("osgi.core:type=framework,version=1.5");
+ } catch (final Exception e) {
+ throw new IllegalStateException("The OSGi JMX implementation references an invalid ObjectName", e);
+ }
+ }
+
+ private volatile MBeanProvider mbeanProvider;
+
+ private final MBeanProviderServiceTracker mbeanProviderServiceTracker = new MBeanProviderServiceTracker();
+
+ private volatile String memento;
+
+ private final int SERVER_TERMINATE_JOB_SCHEDULE_DELAY = 5000;;
+
+ /**
+ *
+ * @param launch
+ * @param launchMode
+ * @param monitor
+ * @throws CoreException
+ */
+ public void configureLaunch(final ILaunch launch, final String launchMode, final IProgressMonitor monitor) throws CoreException {
+ setServerRestartState(false);
+ setServerState(IServer.STATE_STARTING);
+ setMode(launchMode);
+
+ monitor.worked(1);
+
+ memento = launch.getLaunchConfiguration().getMemento();
+
+ monitor.worked(1);
+ }
+
+ @Override
+ public void setupLaunchConfiguration(final ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
+ super.setupLaunchConfiguration(workingCopy, monitor);
+
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+
+ KarafServerLaunchConfigurationInitializer.initializeConfiguration(workingCopy);
+
+ monitor.worked(10);
+ }
+
+ @Override
+ public void stop(final boolean force) {
+ mbeanProviderServiceTracker.close();
+
+ if (force) {
+ terminate();
+ return;
+ }
+
+ final int state = getServer().getServerState();
+
+ if (state == IServer.STATE_STOPPED || state == IServer.STATE_STOPPING) {
+ return;
+ } else if (state == IServer.STATE_STARTING) {
+ terminate();
+ return;
+ } else {
+ setServerState(IServer.STATE_STOPPING);
+
+ try {
+ if (mbeanProvider != null && mbeanProvider.isOpen()) {
+ mbeanProvider.getMBean(FRAMEWORK, FrameworkMBean.class).shutdownFramework();
+ mbeanProvider.close();
+ }
+ } catch (final IOException e) {
+ }
+
+ final Job j = new Job("Waiting for server to stop...") {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ try {
+ final ILaunch launch = getServer().getLaunch();
+ if (launch != null) {
+ launch.terminate();
+ }
+ } catch (final DebugException e) {
+ // Do nothing
+ }
+
+ setServerState(IServer.STATE_STOPPED);
+
+ return Status.OK_STATUS;
+ }
+ };
+
+ j.setSystem(true);
+ j.schedule(SERVER_TERMINATE_JOB_SCHEDULE_DELAY);
+ }
+ }
+
+ @Override
+ protected void publishServer(final int kind, final IProgressMonitor monitor) throws CoreException {
+ if (getServer().getRuntime() == null) {
+ return;
+ }
+
+ monitor.done();
+
+ setServerPublishState(IServer.PUBLISH_STATE_NONE);
+ }
+
+ /**
+ * Terminates the launcher forcibly without regard to application state.
+ */
+ protected void terminate() {
+ if (getServer().getServerState() == IServer.STATE_STOPPED) {
+ return;
+ }
+
+ try {
+ setServerState(IServer.STATE_STOPPING);
+
+ final ILaunch launch = getServer().getLaunch();
+ if (launch != null) {
+ launch.terminate();
+ }
+
+ } catch (final Exception e) {
+ // Ignore as this is forcibly terminating the server
+ } finally {
+ setServerState(IServer.STATE_STOPPED);
+ }
+ }
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerLocator.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerLocator.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerLocator.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/server/KarafServerLocator.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2011 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.core.server;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.server.core.internal.provisional.ServerLocatorDelegate;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+@SuppressWarnings("restriction")
+public class KarafServerLocator extends ServerLocatorDelegate {
+
+ @Override
+ public void searchForServers(final String host, final IServerSearchListener listener,
+ final IProgressMonitor monitor) {
+
+ }
+
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/tasks/AbstractKarafPublishOperation.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/tasks/AbstractKarafPublishOperation.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/tasks/AbstractKarafPublishOperation.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.core/src/main/java/info/evanchik/eclipse/karaf/wtp/core/tasks/AbstractKarafPublishOperation.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.core.tasks;
+
+import info.evanchik.eclipse.karaf.wtp.core.server.KarafServerBehavior;
+
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.PublishOperation;
+import org.eclipse.wst.server.core.util.PublishHelper;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public abstract class AbstractKarafPublishOperation extends PublishOperation {
+
+ protected KarafServerBehavior server;
+
+ protected IModule[] module;
+
+ protected int publicationType;
+
+ protected int moduleOperationType;
+
+ protected PublishHelper helper;
+
+ public AbstractKarafPublishOperation(KarafServerBehavior server, int publicationType, IModule[] module, int moduleOperationType) {
+ super("Publish to server", "Publish module to Karaf server");
+
+ this.server = server;
+ this.module = module;
+ this.publicationType = publicationType;
+ this.moduleOperationType = moduleOperationType;
+ }
+
+ @Override
+ public int getOrder() {
+ return 0;
+ }
+
+ @Override
+ public int getKind() {
+ return REQUIRED;
+ }
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.classpath
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.classpath?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.classpath (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.classpath Wed Jan 4 13:22:10 2012
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.project
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.project?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.project (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/.project Wed Jan 4 13:22:10 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>info.evanchik.eclipse.karaf.wtp.ui</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.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/META-INF/MANIFEST.MF?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/META-INF/MANIFEST.MF (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/META-INF/MANIFEST.MF Wed Jan 4 13:22:10 2012
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse WTP UI Integration
+Bundle-SymbolicName: info.evanchik.eclipse.karaf.wtp.ui;singleton:=true
+Bundle-Version: 0.5.2.qualifier
+Bundle-Activator: info.evanchik.eclipse.karaf.wtp.ui.KarafWtpUIPluginActivator
+Require-Bundle: org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.pde.ui;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.wst.common.project.facet.ui;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.server.ui;bundle-version="[1.0.204,2.0.0)",
+ org.eclipse.wst.server.core;bundle-version="[1.0.204,2.0.0)",
+ org.eclipse.jdt.debug.ui;bundle-version="[3.2.0,4.0.0)",
+ info.evanchik.eclipse.karaf.core;bundle-version="0.5.2",
+ info.evanchik.eclipse.karaf.ui;bundle-version="0.5.2"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: info.evanchik.eclipse.karaf.wtp.ui
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/build.properties
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/build.properties?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/build.properties (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/build.properties Wed Jan 4 13:22:10 2012
@@ -0,0 +1,10 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/,\
+ epl-v10.html,\
+ target/classes/
+src.includes = pom.xml,\
+ epl-v10.html
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/epl-v10.html
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/epl-v10.html?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/epl-v10.html (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/epl-v10.html Wed Jan 4 13:22:10 2012
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body>
+
+</html>
\ No newline at end of file
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj16/felixLogo16x16.gif
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj16/felixLogo16x16.gif?rev=1227144&view=auto
==============================================================================
Files karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj16/felixLogo16x16.gif (added) and karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj16/felixLogo16x16.gif Wed Jan 4 13:22:10 2012 differ
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj32/felixLogo32x32.gif
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj32/felixLogo32x32.gif?rev=1227144&view=auto
==============================================================================
Files karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj32/felixLogo32x32.gif (added) and karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj32/felixLogo32x32.gif Wed Jan 4 13:22:10 2012 differ
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj64/felixLogo64x64.gif
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj64/felixLogo64x64.gif?rev=1227144&view=auto
==============================================================================
Files karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj64/felixLogo64x64.gif (added) and karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/icons/obj64/felixLogo64x64.gif Wed Jan 4 13:22:10 2012 differ
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/plugin.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/plugin.xml?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/plugin.xml (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/plugin.xml Wed Jan 4 13:22:10 2012
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.wst.server.ui.serverImages">
+ <image
+ icon="icons/obj16/felixLogo16x16.gif"
+ id="info.evanchik.eclipse.karaf.server.2"
+ typeIds="info.evanchik.eclipse.karaf.server.2">
+ </image>
+ <image
+ icon="icons/obj16/felixLogo16x16.gif"
+ id="info.evanchik.eclipse.karaf.wtp.server.runtime.2"
+ typeIds="info.evanchik.eclipse.karaf.wtp.server.runtime.2">
+ </image>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.ui.images">
+ <image
+ path="icons/obj16/felixLogo16x16.gif"
+ runtime-component-type="info.evanchik.eclipse.server.karaf">
+ </image>
+ <image
+ category="info.evanchik.eclipse.karaf.wtp.core.category"
+ path="icons/obj16/felixLogo16x16.gif">
+ </image>
+ <image
+ facet="info.evanchik.eclipse.karaf.wtp.core.facets.bundle"
+ path="icons/obj16/felixLogo16x16.gif">
+ </image>
+ </extension>
+ <extension
+ point="org.eclipse.wst.server.ui.wizardFragments">
+ <fragment
+ class="info.evanchik.eclipse.karaf.wtp.ui.KarafRuntimeWizardFragment"
+ id="info.evanchik.eclipse.server.karaf.runtime.12"
+ typeIds="info.evanchik.eclipse.server.karaf.runtime.12">
+ </fragment>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <adapter>
+ <runtime-component
+ id="info.evanchik.eclipse.server.karaf">
+ </runtime-component>
+ <factory
+ class="org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Factory">
+ </factory>
+ <type
+ class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider">
+ </type>
+ </adapter>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ class="info.evanchik.eclipse.karaf.wtp.ui.launcher.KarafLauncherTabGroup"
+ id="info.evanchik.eclipse.karaf.wtp.ui.KarafLauncherTabGroup"
+ type="info.evanchik.eclipse.karaf.wtp.core.KarafServerLauncher">
+ </launchConfigurationTabGroup>
+ </extension>
+
+</plugin>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/pom.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/pom.xml?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/pom.xml (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/pom.xml Wed Jan 4 13:22:10 2012
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ Copyright (c) 2009 Stephen Evanchik
+ 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:
+ Stephen Evanchik - initial implementation
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>info.evanchik.eclipse.karaf</groupId>
+ <artifactId>eik-plugins-parent</artifactId>
+ <version>1.0.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>info.evanchik.eclipse.karaf</groupId>
+ <artifactId>info.evanchik.eclipse.karaf.core</artifactId>
+ <version>0.5.2-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>Eclipse Integration for Karaf :: WTP UI Integration</name>
+ <description>Provides UI integration for Web Tools Platform</description>
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>${pom.basedir}/src/main/filtered-resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <!-- enable source bundle generation -->
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <executions>
+ <execution>
+ <id>plugin-source</id>
+ <goals>
+ <goal>plugin-source</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeComposite.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeComposite.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeComposite.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeComposite.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,242 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.ui;
+
+import info.evanchik.eclipse.karaf.ui.KarafUIPluginActivator;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class KarafRuntimeComposite extends Composite {
+
+ /**
+ * The handle to the wizard that this {@link Composite} is associated with.
+ */
+ private final IWizardHandle wizard;
+
+ /**
+ * The non-persistent work object used to build up the {@link IRuntime}
+ * instance for this Karaf Runtime installation.
+ */
+ private IRuntimeWorkingCopy karafRuntimeWC;
+
+ /*
+ * UI Controls
+ */
+
+ /**
+ * A meaningful name to this runtime as given by the user
+ */
+ protected Text name;
+
+ /**
+ * The Karaf Runtime installation directory as selected by the user
+ */
+ protected Text installDir;
+
+ /**
+ * Constructor.
+ *
+ * @param parent
+ * the parent of this {@link Composite} control
+ * @param w
+ * the {@link IWizardHandle} of the wizard fragment
+ */
+ public KarafRuntimeComposite(final Composite parent, final IWizardHandle w) {
+ super(parent, SWT.NONE);
+
+ this.wizard = w;
+
+ this.wizard.setTitle("Karaf Server");
+ this.wizard.setDescription("Specify the installation directory");
+ this.wizard.setImageDescriptor(KarafUIPluginActivator.getDefault().getImageRegistry().getDescriptor("logo64")); //$NON-NLS-1$
+
+ createCompositeControls();
+ }
+
+ /**
+ * Setter for the non-persistent work object used to build up the
+ * {@link IRuntime}
+ *
+ * @param karafRuntimeWC
+ * the {@link IRuntimeWorkingCopy} used in this instance of the
+ * wizard
+ */
+ protected void setKarafRuntimeWC(final IRuntimeWorkingCopy karafRuntimeWC) {
+ this.karafRuntimeWC = karafRuntimeWC;
+
+ initializeWizard();
+ validateWizardState();
+ }
+
+ /**
+ * Creates the necessary controls on this composite:<br>
+ * <br>
+ * - A text box for the name<br>
+ * - A text box for the directory of the Karaf installation<br>
+ */
+ private void createCompositeControls() {
+ final GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+
+ setLayout(layout);
+ setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, "org.apache.felix.karaf...");
+
+ /*
+ * Runtime name label and text box
+ *
+ * The runtime name controls
+ */
+ Label label = new Label(this, SWT.NONE);
+ label.setText("Runtime name");
+ GridData data = new GridData();
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+
+ name = new Text(this, SWT.BORDER);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ name.setLayoutData(data);
+ name.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(final ModifyEvent e) {
+ karafRuntimeWC.setName(name.getText());
+ validateWizardState();
+ }
+ });
+
+ // The installation directory selection controls
+ label = new Label(this, SWT.NONE);
+ label.setText("Installation directory");
+ data = new GridData();
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+
+ installDir = new Text(this, SWT.BORDER);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ installDir.setLayoutData(data);
+ installDir.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(final ModifyEvent e) {
+ karafRuntimeWC.setLocation(new Path(installDir.getText()));
+ validateWizardState();
+ }
+ });
+
+ // File system browse button
+ final Button browse = KarafRuntimeUtils.createButton(this, "Browse");
+ browse.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent se) {
+ final DirectoryDialog dialog = new DirectoryDialog(KarafRuntimeComposite.this.getShell());
+ dialog.setMessage("Select Karaf installation directory");
+ dialog.setFilterPath(installDir.getText());
+
+ final String selectedDirectory = dialog.open();
+
+ if (selectedDirectory != null) {
+ installDir.setText(selectedDirectory);
+ }
+ }
+ });
+
+ initializeWizard();
+ validateWizardState();
+
+ Dialog.applyDialogFont(this);
+
+ name.forceFocus();
+ }
+
+ /**
+ * Initializes the wizard's state to any previously set values if applicable
+ * or sets the defaults (empty text) of no values are present.
+ */
+ protected void initializeWizard() {
+ if (!isWizardDataInitialized()) {
+ return;
+ }
+
+ if (karafRuntimeWC.getName() != null) {
+ name.setText(karafRuntimeWC.getName());
+ } else {
+ name.setText("");
+ }
+
+ if (karafRuntimeWC.getLocation() != null) {
+ installDir.setText(karafRuntimeWC.getLocation().toOSString());
+ } else {
+ installDir.setText("");
+ }
+ }
+
+ /**
+ * Validate the state of the wizard based on the results of the listeners on
+ * the various controls.
+ */
+ protected void validateWizardState() {
+ if (karafRuntimeWC == null) {
+ wizard.setMessage("", IMessageProvider.ERROR);
+ return;
+ }
+
+ final IStatus status = karafRuntimeWC.validate(null);
+ if (status == null || status.isOK()) {
+ wizard.setMessage(null, IMessageProvider.NONE);
+ } else if (status.getSeverity() == IStatus.WARNING) {
+ wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
+ } else {
+ wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
+ }
+
+ wizard.update();
+ }
+
+ /**
+ * Determines if the wizard has all of its data initialized. The {@code
+ * name} field will be initialized when the {@code Composite} is created,
+ * the {@link runtime} field will be initialized after the {@link Composite}
+ * has been initialized and when the user enter's the wizard.
+ *
+ * @return true if the wizard's internal data is fully initialized, false
+ * otherwise
+ */
+ private boolean isWizardDataInitialized() {
+ if (name == null || karafRuntimeWC == null) {
+ return false;
+ }
+
+ return true;
+ }
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeUtils.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeUtils.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeUtils.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeUtils.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.ui;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public final class KarafRuntimeUtils {
+ private static FontMetrics fontMetrics;
+
+ protected static void initializeDialogUnits(Control testControl) {
+ // Compute and store a font metric
+ GC gc = new GC(testControl);
+ gc.setFont(JFaceResources.getDialogFont());
+ fontMetrics = gc.getFontMetrics();
+ gc.dispose();
+ }
+
+ /**
+ * Returns a width hint for a button control.
+ */
+ protected static int getButtonWidthHint(Button button) {
+ int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
+ return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+ }
+
+ /**
+ * Create a new button with the standard size.
+ *
+ * @param comp the component to add the button to
+ * @param label the button label
+ * @return a button
+ */
+ public static Button createButton(Composite comp, String label) {
+ Button b = new Button(comp, SWT.PUSH);
+ b.setText(label);
+ if (fontMetrics == null)
+ initializeDialogUnits(comp);
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ data.widthHint = getButtonWidthHint(b);
+ b.setLayoutData(data);
+ return b;
+ }
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeWizardFragment.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeWizardFragment.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeWizardFragment.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafRuntimeWizardFragment.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.ui;
+
+import info.evanchik.eclipse.karaf.ui.KarafUIPluginActivator;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+import org.eclipse.wst.server.ui.wizard.WizardFragment;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class KarafRuntimeWizardFragment extends WizardFragment {
+
+ /**
+ * The {@link Composite} control that displays this wizard's UI elements.
+ */
+ private KarafRuntimeComposite karafComposite;
+
+ /**
+ * Constructor that does nothing.
+ */
+ public KarafRuntimeWizardFragment() {
+ }
+
+ /**
+ * Creates the UI controls for this {@link WizardFragment}.
+ */
+ @Override
+ public Composite createComposite(Composite parent, IWizardHandle handle) {
+ karafComposite = new KarafRuntimeComposite(parent, handle);
+ return karafComposite;
+ }
+
+ /**
+ * Establish the {@link IRuntimeWorkingCopy} that will be used to build up
+ * the final {@link IRuntime} instance<br>
+ *
+ */
+ @Override
+ public void enter() {
+ if (karafComposite == null) {
+ return;
+ }
+
+ final IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(
+ TaskModel.TASK_RUNTIME);
+
+ karafComposite.setKarafRuntimeWC(runtime);
+
+ }
+
+ @Override
+ public void exit() {
+ final IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(
+ TaskModel.TASK_RUNTIME);
+
+ if (runtime.validate(null).getSeverity() != IStatus.ERROR) {
+ final IPath path = runtime.getLocation();
+
+ // Save the runtime's location in the preferences area for this
+ // plugin for easy retrieval
+ KarafUIPluginActivator.getDefault().getPluginPreferences().setValue(
+ "location" + runtime.getRuntimeType().getId(), path.toString()); // $NON-NLS-1$
+ KarafUIPluginActivator.getDefault().savePluginPreferences();
+ }
+
+ }
+
+ /**
+ * This {@link WizardFragment} has UI elements to display (a
+ * {@link Composite})
+ *
+ * @return true, UI elements are contributed
+ */
+ @Override
+ public boolean hasComposite() {
+ return true;
+ }
+
+ /**
+ * This wizard is complete when the {@link IRuntimeWorkingCopy} successfully
+ * validates. This happens when there is a name that does not conflict with
+ * other names and the installation directory points to a valid Karaf
+ * installation as determined by the {@code runtimeType} extension.
+ */
+ @Override
+ public boolean isComplete() {
+ final IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(
+ TaskModel.TASK_RUNTIME);
+
+ if (runtime == null) {
+ return false;
+ }
+
+ final IStatus status = runtime.validate(null);
+ return (status == null || status.getSeverity() != IStatus.ERROR);
+ }
+
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafWtpUIPluginActivator.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafWtpUIPluginActivator.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafWtpUIPluginActivator.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/KarafWtpUIPluginActivator.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.ui;
+
+import info.evanchik.eclipse.karaf.core.LogWrapper;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class KarafWtpUIPluginActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "info.evanchik.eclipse.karaf.wtp.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static KarafWtpUIPluginActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public KarafWtpUIPluginActivator() {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static KarafWtpUIPluginActivator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Getter for the {@link LogWrapper} object that makes logging much easier
+ * on the caller.
+ *
+ * @return the {@link LogWrapper} instance
+ */
+ public static LogWrapper getLogger() {
+ return new LogWrapper(getDefault().getLog(), PLUGIN_ID);
+ }
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafLauncherTabGroup.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafLauncherTabGroup.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafLauncherTabGroup.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafLauncherTabGroup.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.ui.launcher;
+
+import info.evanchik.eclipse.karaf.ui.KarafConfigurationTab;
+import info.evanchik.eclipse.karaf.ui.KarafLaunchConfigurationInitializer;
+
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
+import org.eclipse.pde.ui.launcher.OSGiSettingsTab;
+import org.eclipse.pde.ui.launcher.TracingTab;
+import org.eclipse.wst.server.ui.ServerLaunchConfigurationTab;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class KarafLauncherTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ /**
+ * Creates the necessary tabs for this launch configuration.
+ *
+ * @see ILaunchConfigurationTabGroup
+ */
+ @Override
+ public void createTabs(final ILaunchConfigurationDialog dialog, final String mode) {
+ final ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new ServerLaunchConfigurationTab(new String[] { "info.evanchik.eclipse.karaf.server" }), //$NON-NLS-1$
+ new JavaArgumentsTab(),
+ new OSGiSettingsTab(),
+ new TracingTab(),
+ new KarafConfigurationTab(),
+ new EnvironmentTab(),
+ new CommonTab()
+ };
+ setTabs(tabs);
+ }
+
+ /**
+ * Sets the defaults for the tab group and launch configuration using
+ * {@link KarafLaunchConfigurationInitializer} in <b>addition</b> to the
+ * defaults set by the OSGi framework.
+ *
+ * @param configuration
+ * the working copy of the launch configuration
+ */
+ @Override
+ public void setDefaults(final ILaunchConfigurationWorkingCopy configuration) {
+ super.setDefaults(configuration);
+ }
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafServerLaunchShortcut.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafServerLaunchShortcut.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafServerLaunchShortcut.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.karaf.wtp.ui/src/main/java/info/evanchik/eclipse/karaf/wtp/ui/launcher/KarafServerLaunchShortcut.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2009 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.karaf.wtp.ui.launcher;
+
+import info.evanchik.eclipse.karaf.ui.KarafLaunchConfigurationInitializer;
+
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.pde.ui.launcher.OSGiLaunchShortcut;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class KarafServerLaunchShortcut extends OSGiLaunchShortcut {
+
+ @Override
+ protected String getLaunchConfigurationTypeName() {
+ return "info.evanchik.eclipse.karaf.wtp.ui.KarafLauncher"; //$NON-NLS-1$
+ }
+
+ @Override
+ protected void initializeConfiguration(
+ ILaunchConfigurationWorkingCopy configuration) {
+ super.initializeConfiguration(configuration);
+
+ KarafLaunchConfigurationInitializer.initializeConfiguration(configuration);
+ }
+
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.classpath
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.classpath?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.classpath (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.classpath Wed Jan 4 13:22:10 2012
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.project
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.project?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.project (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/.project Wed Jan 4 13:22:10 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>info.evanchik.eclipse.smk</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>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/META-INF/MANIFEST.MF?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/META-INF/MANIFEST.MF (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/META-INF/MANIFEST.MF Wed Jan 4 13:22:10 2012
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Eclipse Platform Model for Apache ServiceMix Kernel
+Bundle-SymbolicName: info.evanchik.eclipse.smk;singleton:=true
+Bundle-Version: 0.5.0.qualifier
+Bundle-Activator: info.evanchik.eclipse.smk.internal.ServiceMixKernelActivator
+Bundle-Vendor: evanchik.info
+Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
+ org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.pde.core;bundle-version="[3.2.0,4.0.0)",
+ org.apache.servicemix.kernel.main;bundle-version="1.1.0",
+ info.evanchik.eclipse.karaf.core;bundle-version="0.5.0",
+ info.evanchik.eclipse.karaf.ui;bundle-version="0.5.0",
+ info.evanchik.eclipse.karaf.workbench;bundle-version="0.5.0",
+ info.evanchik.smk.app;bundle-version="0.5.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/build.properties
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/build.properties?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/build.properties (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/build.properties Wed Jan 4 13:22:10 2012
@@ -0,0 +1,5 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/epl-v10.html
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/epl-v10.html?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/epl-v10.html (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/epl-v10.html Wed Jan 4 13:22:10 2012
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body>
+
+</html>
\ No newline at end of file
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/plugin.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/plugin.xml?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/plugin.xml (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/plugin.xml Wed Jan 4 13:22:10 2012
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="servicemixKernel"
+ name="Eclipse Platform model for Apache ServiceMix Kernel"
+ point="info.evanchik.eclipse.karaf.core.platformModel">
+ <model
+ class="info.evanchik.eclipse.smk.ServiceMixKernelPlatformModelFactory">
+ <triggerBundle
+ symbolicName="org.apache.servicemix.kernel.main">
+ </triggerBundle>
+ <triggerBundle
+ symbolicName="org.apache.servicemix.kernel.jaas.boot">
+ </triggerBundle>
+ </model>
+ </extension>
+ <extension
+ id="servicemix.kernel"
+ name="Eclipse Support for Apache ServiceMix Kernel"
+ point="info.evanchik.eclipse.karaf.ui.service">
+ <launchCustomizer
+ class="info.evanchik.eclipse.smk.ServiceMixKernelWorkbenchServiceFactory">
+ </launchCustomizer>
+ </extension>
+
+</plugin>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/pom.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/pom.xml?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/pom.xml (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/pom.xml Wed Jan 4 13:22:10 2012
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ Copyright (c) 2009 Stephen Evanchik
+ 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:
+ Stephen Evanchik - initial implementation
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>info.evanchik.eclipse.karaf</groupId>
+ <artifactId>eik-plugins-parent</artifactId>
+ <version>1.0.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>info.evanchik.eclipse.karaf</groupId>
+ <artifactId>info.evanchik.eclipse.smk</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <name>Eclipse Integration for Karaf :: Apache ServiceMix Kernel integration</name>
+ <description>Provides Apache ServiceMix Kernel integration</description>
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>${pom.basedir}/src/main/filtered-resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <!-- enable source bundle generation -->
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <executions>
+ <execution>
+ <id>plugin-source</id>
+ <goals>
+ <goal>plugin-source</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelPlatformModelFactory.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelPlatformModelFactory.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelPlatformModelFactory.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelPlatformModelFactory.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2010 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.smk;
+
+import info.evanchik.eclipse.karaf.core.KarafPlatformModel;
+import info.evanchik.eclipse.karaf.core.KarafPlatformModelFactory;
+import info.evanchik.eclipse.karaf.core.KarafPlatformValidator;
+import info.evanchik.eclipse.smk.internal.ServiceMixKernelPlatformModel;
+import info.evanchik.eclipse.smk.internal.ServiceMixKernelPlatformValidator;
+
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class ServiceMixKernelPlatformModelFactory implements KarafPlatformModelFactory {
+
+ private static final ServiceMixKernelPlatformValidator platformValidator =
+ new ServiceMixKernelPlatformValidator();
+
+ @Override
+ public KarafPlatformModel getPlatformModel(final IPath rootDirectory) {
+ if (!platformValidator.isValid(rootDirectory)) {
+
+ }
+
+ return new ServiceMixKernelPlatformModel(rootDirectory);
+ }
+
+ @Override
+ public KarafPlatformValidator getPlatformValidator() {
+ return platformValidator;
+ }
+
+}
Added: karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelWorkbenchServiceFactory.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelWorkbenchServiceFactory.java?rev=1227144&view=auto
==============================================================================
--- karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelWorkbenchServiceFactory.java (added)
+++ karaf/eik/trunk/plugins/info.evanchik.eclipse.smk/src/main/java/info/evanchik/eclipse/smk/ServiceMixKernelWorkbenchServiceFactory.java Wed Jan 4 13:22:10 2012
@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) 2010 Stephen Evanchik
+ * 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:
+ * Stephen Evanchik - initial implementation
+ */
+package info.evanchik.eclipse.smk;
+
+import info.evanchik.eclipse.karaf.ui.workbench.KarafWorkbenchService;
+import info.evanchik.eclipse.karaf.ui.workbench.KarafWorkbenchServiceFactory;
+import info.evanchik.eclipse.smk.internal.ServiceMixKernelWorkbenchService;
+
+/**
+ * @author Stephen Evanchik (evanchsa@gmail.com)
+ *
+ */
+public class ServiceMixKernelWorkbenchServiceFactory implements KarafWorkbenchServiceFactory {
+
+ public KarafWorkbenchService getWorkbenchService() {
+ return new ServiceMixKernelWorkbenchService();
+ }
+
+}