diff options
author | rbrooks | 2010-07-24 08:02:08 +0000 |
---|---|---|
committer | rbrooks | 2010-07-24 08:02:08 +0000 |
commit | 4ed8bddc791fda93940f238c5135556a07041dc0 (patch) | |
tree | 64a118285c5006c3a38320dbb2d374e8ea72a061 /plugins/org.eclipse.osee.framework.lifecycle/src | |
parent | 542cc7344d3f129d64e47f547384297c8e1b1f43 (diff) | |
download | org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.gz org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.xz org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.zip |
converted all line terminators to unix style
Diffstat (limited to 'plugins/org.eclipse.osee.framework.lifecycle/src')
11 files changed, 409 insertions, 409 deletions
diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleOperation.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleOperation.java index 7c775eac73f..f74e45dc4a5 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleOperation.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleOperation.java @@ -1,53 +1,53 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osee.framework.lifecycle;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.lifecycle.internal.OperationPointId;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public abstract class AbstractLifecycleOperation extends AbstractOperation {
-
- private final ILifecycleService service;
- private final AbstractLifecyclePoint<?> lifecyclepoint;
-
- public AbstractLifecycleOperation(ILifecycleService service, AbstractLifecyclePoint<?> lifecyclePoint, String operationName, String pluginId) {
- super(operationName, pluginId);
- this.service = service;
- this.lifecyclepoint = lifecyclePoint;
- }
-
- @Override
- protected final void doWork(IProgressMonitor monitor) throws Exception {
- doPointWork(monitor, OperationPointId.CHECK_CONDITION_ID);
- doPointWork(monitor, OperationPointId.PRE_CONDITION_ID);
- try {
- doCoreWork(monitor);
- } finally {
- doPointWork(monitor, OperationPointId.POST_CONDITION_ID);
- }
- }
-
- private void doPointWork(IProgressMonitor monitor, OperationPointId pointId) throws Exception {
- IStatus status = service.dispatch(monitor, lifecyclepoint, pointId.name());
- setStatus(status);
- checkForErrorsOrCanceled(monitor);
- }
-
- abstract protected void doCoreWork(IProgressMonitor monitor) throws Exception;
-
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ + +package org.eclipse.osee.framework.lifecycle; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.core.operation.AbstractOperation; +import org.eclipse.osee.framework.lifecycle.internal.OperationPointId; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public abstract class AbstractLifecycleOperation extends AbstractOperation { + + private final ILifecycleService service; + private final AbstractLifecyclePoint<?> lifecyclepoint; + + public AbstractLifecycleOperation(ILifecycleService service, AbstractLifecyclePoint<?> lifecyclePoint, String operationName, String pluginId) { + super(operationName, pluginId); + this.service = service; + this.lifecyclepoint = lifecyclePoint; + } + + @Override + protected final void doWork(IProgressMonitor monitor) throws Exception { + doPointWork(monitor, OperationPointId.CHECK_CONDITION_ID); + doPointWork(monitor, OperationPointId.PRE_CONDITION_ID); + try { + doCoreWork(monitor); + } finally { + doPointWork(monitor, OperationPointId.POST_CONDITION_ID); + } + } + + private void doPointWork(IProgressMonitor monitor, OperationPointId pointId) throws Exception { + IStatus status = service.dispatch(monitor, lifecyclepoint, pointId.name()); + setStatus(status); + checkForErrorsOrCanceled(monitor); + } + + abstract protected void doCoreWork(IProgressMonitor monitor) throws Exception; + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecyclePoint.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecyclePoint.java index 243d273ec37..a52de34c36a 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecyclePoint.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecyclePoint.java @@ -1,55 +1,55 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osee.framework.lifecycle.internal.OperationPointId;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public abstract class AbstractLifecyclePoint<H extends LifecycleOpHandler> extends AbstractLifecycleVisitor<H> {
-
- protected AbstractLifecyclePoint() {
- }
-
- /**
- * Should only be called by {@link ILifecycleService}.
- */
- @Override
- final protected IStatus dispatch(IProgressMonitor monitor, H handler, String sourceId) {
- initializeHandlerData(handler);
-
- IStatus status = Status.OK_STATUS;
- OperationPointId pointId = OperationPointId.toEnum(sourceId);
- switch (pointId) {
- case CHECK_CONDITION_ID:
- status = handler.onCheck(monitor);
- break;
- case PRE_CONDITION_ID:
- status = handler.onPreCondition(monitor);
- break;
- case POST_CONDITION_ID:
- status = handler.onPostCondition(monitor);
- break;
- case NOOP_ID:
- default:
- break;
- }
- return status;
- }
-
- protected abstract void initializeHandlerData(H handler);
-
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.osee.framework.lifecycle.internal.OperationPointId; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public abstract class AbstractLifecyclePoint<H extends LifecycleOpHandler> extends AbstractLifecycleVisitor<H> { + + protected AbstractLifecyclePoint() { + } + + /** + * Should only be called by {@link ILifecycleService}. + */ + @Override + final protected IStatus dispatch(IProgressMonitor monitor, H handler, String sourceId) { + initializeHandlerData(handler); + + IStatus status = Status.OK_STATUS; + OperationPointId pointId = OperationPointId.toEnum(sourceId); + switch (pointId) { + case CHECK_CONDITION_ID: + status = handler.onCheck(monitor); + break; + case PRE_CONDITION_ID: + status = handler.onPreCondition(monitor); + break; + case POST_CONDITION_ID: + status = handler.onPostCondition(monitor); + break; + case NOOP_ID: + default: + break; + } + return status; + } + + protected abstract void initializeHandlerData(H handler); + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleVisitor.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleVisitor.java index 6644cf8469c..4a3c307922e 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleVisitor.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/AbstractLifecycleVisitor.java @@ -1,51 +1,51 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public abstract class AbstractLifecycleVisitor<H extends LifecycleHandler> {
-
- public static class Type<H> {
- private static int nextHashCode;
- private final int index;
-
- public Type() {
- index = ++nextHashCode;
- }
-
- @Override
- public final int hashCode() {
- return index;
- }
-
- @Override
- public String toString() {
- return "Handler Type";
- }
- }
-
- protected AbstractLifecycleVisitor() {
- }
-
- public abstract Type<H> getAssociatedType();
-
- /**
- * Should only be called by {@link ILifecycleService}.
- */
- protected abstract IStatus dispatch(IProgressMonitor monitor, H handler, String sourceId);
-
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public abstract class AbstractLifecycleVisitor<H extends LifecycleHandler> { + + public static class Type<H> { + private static int nextHashCode; + private final int index; + + public Type() { + index = ++nextHashCode; + } + + @Override + public final int hashCode() { + return index; + } + + @Override + public String toString() { + return "Handler Type"; + } + } + + protected AbstractLifecycleVisitor() { + } + + public abstract Type<H> getAssociatedType(); + + /** + * Should only be called by {@link ILifecycleService}. + */ + protected abstract IStatus dispatch(IProgressMonitor monitor, H handler, String sourceId); + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/IAccessCheckProvider.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/IAccessCheckProvider.java index ec036f70bb9..a9090545dd3 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/IAccessCheckProvider.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/IAccessCheckProvider.java @@ -8,11 +8,11 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.lifecycle;
-
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
-
-public interface IAccessCheckProvider {
- public boolean canEdit(IBasicArtifact<?> user, IBasicArtifact<?> artTcheck);
-
-}
+package org.eclipse.osee.framework.lifecycle; + +import org.eclipse.osee.framework.core.model.IBasicArtifact; + +public interface IAccessCheckProvider { + public boolean canEdit(IBasicArtifact<?> user, IBasicArtifact<?> artTcheck); + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleService.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleService.java index 073742d5396..591125b3442 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleService.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleService.java @@ -1,33 +1,33 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-public interface ILifecycleService {
-
- public <H extends LifecycleHandler> void addHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException;
-
- public <H extends LifecycleHandler> void removeHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException;
-
- public Collection<AbstractLifecycleVisitor.Type<?>> getHandlerTypes();
-
- public int getHandlerCount(AbstractLifecycleVisitor.Type<?> type);
-
- public <H extends LifecycleHandler> IStatus dispatch(IProgressMonitor monitor, AbstractLifecycleVisitor<H> accessPoint, String sourceId);
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +import java.util.Collection; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.core.exception.OseeCoreException; + +public interface ILifecycleService { + + public <H extends LifecycleHandler> void addHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException; + + public <H extends LifecycleHandler> void removeHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException; + + public Collection<AbstractLifecycleVisitor.Type<?>> getHandlerTypes(); + + public int getHandlerCount(AbstractLifecycleVisitor.Type<?> type); + + public <H extends LifecycleHandler> IStatus dispatch(IProgressMonitor monitor, AbstractLifecycleVisitor<H> accessPoint, String sourceId); +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleServiceProvider.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleServiceProvider.java index 0b9577e86be..48d1b357e13 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleServiceProvider.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/ILifecycleServiceProvider.java @@ -8,13 +8,13 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.lifecycle;
-
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-/**
- * @author Jeff C. Phillips
- */
-public interface ILifecycleServiceProvider {
- public ILifecycleService getLifecycleServices() throws OseeCoreException;
-}
+package org.eclipse.osee.framework.lifecycle; + +import org.eclipse.osee.framework.core.exception.OseeCoreException; + +/** + * @author Jeff C. Phillips + */ +public interface ILifecycleServiceProvider { + public ILifecycleService getLifecycleServices() throws OseeCoreException; +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleHandler.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleHandler.java index 26bdca45ad3..13d893a5605 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleHandler.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleHandler.java @@ -1,19 +1,19 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public interface LifecycleHandler {
-
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public interface LifecycleHandler { + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleOpHandler.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleOpHandler.java index dd153d8260b..0d6b5a4a83f 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleOpHandler.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleOpHandler.java @@ -1,27 +1,27 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-public interface LifecycleOpHandler extends LifecycleHandler {
-
- IStatus onPreCondition(IProgressMonitor monitor);
-
- IStatus onPostCondition(IProgressMonitor monitor);
-
- IStatus onCheck(IProgressMonitor monitor);
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; + +public interface LifecycleOpHandler extends LifecycleHandler { + + IStatus onPreCondition(IProgressMonitor monitor); + + IStatus onPostCondition(IProgressMonitor monitor); + + IStatus onCheck(IProgressMonitor monitor); +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleServiceImpl.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleServiceImpl.java index eb3c2913494..68f36e4b520 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleServiceImpl.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/LifecycleServiceImpl.java @@ -1,76 +1,76 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.util.Conditions;
-import org.eclipse.osee.framework.jdk.core.type.HashCollection;
-
-public class LifecycleServiceImpl implements ILifecycleService {
-
- private final HashCollection<AbstractLifecycleVisitor.Type<?>, LifecycleHandler> handlersByType =
- new HashCollection<AbstractLifecycleVisitor.Type<?>, LifecycleHandler>();
- private final HashCollection<String, LifecycleHandler> handlersById = new HashCollection<String, LifecycleHandler>();
-
- public LifecycleServiceImpl() {
- }
-
- public Collection<AbstractLifecycleVisitor.Type<?>> getHandlerTypes() {
- return handlersByType.keySet();
- }
-
- @SuppressWarnings("unchecked")
- private <H> ArrayList<H> get(AbstractLifecycleVisitor.Type<H> type) {
- return (ArrayList<H>) handlersByType.getValues(type);
- }
-
- public <H extends LifecycleHandler> IStatus dispatch(IProgressMonitor monitor, AbstractLifecycleVisitor<H> visitor, String sourceId) {
- AbstractLifecycleVisitor.Type<H> type = visitor.getAssociatedType();
- IStatus status = null;
- Collection<H> handlers = get(type);
- if (handlers != null) {
- for (H handler : handlers) {
- status = visitor.dispatch(monitor, handler, sourceId);
- if (!status.isOK()) {
- break;
- }
- }
- }
- return status;
- }
-
- public int getHandlerCount(AbstractLifecycleVisitor.Type<?> type) {
- ArrayList<?> handlers = get(type);
- return handlers == null ? 0 : handlers.size();
- }
-
- public <H extends LifecycleHandler> void addHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException {
- Conditions.checkNotNull(type, "handler type");
- Conditions.checkNotNull(handler, "handler");
- handlersByType.put(type, handler);
-
- handlersById.put("", handler);
- }
-
- public <H extends LifecycleHandler> void removeHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException {
- Conditions.checkNotNull(type, "handler type");
- Conditions.checkNotNull(handler, "handler");
- handlersByType.removeValue(type, handler);
- }
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +import java.util.ArrayList; +import java.util.Collection; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.util.Conditions; +import org.eclipse.osee.framework.jdk.core.type.HashCollection; + +public class LifecycleServiceImpl implements ILifecycleService { + + private final HashCollection<AbstractLifecycleVisitor.Type<?>, LifecycleHandler> handlersByType = + new HashCollection<AbstractLifecycleVisitor.Type<?>, LifecycleHandler>(); + private final HashCollection<String, LifecycleHandler> handlersById = new HashCollection<String, LifecycleHandler>(); + + public LifecycleServiceImpl() { + } + + public Collection<AbstractLifecycleVisitor.Type<?>> getHandlerTypes() { + return handlersByType.keySet(); + } + + @SuppressWarnings("unchecked") + private <H> ArrayList<H> get(AbstractLifecycleVisitor.Type<H> type) { + return (ArrayList<H>) handlersByType.getValues(type); + } + + public <H extends LifecycleHandler> IStatus dispatch(IProgressMonitor monitor, AbstractLifecycleVisitor<H> visitor, String sourceId) { + AbstractLifecycleVisitor.Type<H> type = visitor.getAssociatedType(); + IStatus status = null; + Collection<H> handlers = get(type); + if (handlers != null) { + for (H handler : handlers) { + status = visitor.dispatch(monitor, handler, sourceId); + if (!status.isOK()) { + break; + } + } + } + return status; + } + + public int getHandlerCount(AbstractLifecycleVisitor.Type<?> type) { + ArrayList<?> handlers = get(type); + return handlers == null ? 0 : handlers.size(); + } + + public <H extends LifecycleHandler> void addHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException { + Conditions.checkNotNull(type, "handler type"); + Conditions.checkNotNull(handler, "handler"); + handlersByType.put(type, handler); + + handlersById.put("", handler); + } + + public <H extends LifecycleHandler> void removeHandler(AbstractLifecycleVisitor.Type<H> type, final H handler) throws OseeCoreException { + Conditions.checkNotNull(type, "handler type"); + Conditions.checkNotNull(handler, "handler"); + handlersByType.removeValue(type, handler); + } +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/Activator.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/Activator.java index 89c21b0f09f..7dcd4b583be 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/Activator.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/Activator.java @@ -1,45 +1,45 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle.internal;
-
-import org.eclipse.osee.framework.lifecycle.ILifecycleService;
-import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public class Activator implements BundleActivator {
- public static final String PLUGIN_ID = "org.eclipse.osee.framework.lifecycle";
- private ServiceRegistration service;
-
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- service = context.registerService(ILifecycleService.class.getName(), new LifecycleServiceImpl(), null);
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- service.unregister();
- }
-}
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle.internal; + +import org.eclipse.osee.framework.lifecycle.ILifecycleService; +import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public class Activator implements BundleActivator { + public static final String PLUGIN_ID = "org.eclipse.osee.framework.lifecycle"; + private ServiceRegistration service; + + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + service = context.registerService(ILifecycleService.class.getName(), new LifecycleServiceImpl(), null); + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + service.unregister(); + } +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/OperationPointId.java b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/OperationPointId.java index 8048f634361..1a2d23e5f27 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/OperationPointId.java +++ b/plugins/org.eclipse.osee.framework.lifecycle/src/org/eclipse/osee/framework/lifecycle/internal/OperationPointId.java @@ -1,33 +1,33 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.lifecycle.internal;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public enum OperationPointId {
- NOOP_ID,
- PRE_CONDITION_ID,
- POST_CONDITION_ID,
- CHECK_CONDITION_ID;
-
- public static OperationPointId toEnum(String sourceId) {
- OperationPointId toReturn = OperationPointId.NOOP_ID;
- for (OperationPointId pointId : OperationPointId.values()) {
- if (pointId.name().equalsIgnoreCase(sourceId)) {
- toReturn = pointId;
- break;
- }
- }
- return toReturn;
- }
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.lifecycle.internal; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public enum OperationPointId { + NOOP_ID, + PRE_CONDITION_ID, + POST_CONDITION_ID, + CHECK_CONDITION_ID; + + public static OperationPointId toEnum(String sourceId) { + OperationPointId toReturn = OperationPointId.NOOP_ID; + for (OperationPointId pointId : OperationPointId.values()) { + if (pointId.name().equalsIgnoreCase(sourceId)) { + toReturn = pointId; + break; + } + } + return toReturn; + } }
\ No newline at end of file |