Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2015-04-03 12:07:52 -0400
committerjmisinco2015-04-03 12:07:52 -0400
commit449506a8e0a899b825fce4f5f46f3d7c0561a0ff (patch)
tree15b9fcb567ccacf6290e1e3cfeb343dbea10e064 /plugins/org.eclipse.osee.framework.resource.management/src
parent77e71f0d008a81b16463130065411d3b754c0e9b (diff)
downloadorg.eclipse.osee-449506a8e0a899b825fce4f5f46f3d7c0561a0ff.tar.gz
org.eclipse.osee-449506a8e0a899b825fce4f5f46f3d7c0561a0ff.tar.xz
org.eclipse.osee-449506a8e0a899b825fce4f5f46f3d7c0561a0ff.zip
refactor[ats_ATS186558]: Remove unused ResourceListener from ResourceManager
Diffstat (limited to 'plugins/org.eclipse.osee.framework.resource.management/src')
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java50
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java10
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java55
3 files changed, 0 insertions, 115 deletions
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java
deleted file mode 100644
index 0fefb369d2..0000000000
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * 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.resource.management;
-
-import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResourceListener {
-
- /**
- * Event triggered before a resource is deleted
- */
- public void onPreDelete(IResourceLocator locator);
-
- /**
- * Event triggered after a resource is deleted
- */
- public void onPostDelete(IResourceLocator locator);
-
- /**
- * Event triggered before a resource is saved
- */
- public void onPreSave(IResourceLocator locator, IResource resource, PropertyStore options);
-
- /**
- * Event triggered after a resource is saved
- */
- public void onPostSave(IResourceLocator locator, IResource resource, PropertyStore options);
-
- /**
- * Event triggered before a resource is acquired
- */
- public void onPreAcquire(IResourceLocator locator);
-
- /**
- * Event triggered after a resource is acquired
- */
- public void onPostAcquire(IResource resource);
-
-}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java
index 4010d8aee1..eaf351c68a 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java
@@ -24,16 +24,6 @@ public interface IResourceManager {
public static final int RESOURCE_NOT_FOUND = 3;
/**
- * Add listener to list
- */
- boolean addResourceListener(IResourceListener listener);
-
- /**
- * Remove listener from list
- */
- boolean removeResourceListener(IResourceListener listener);
-
- /**
* Acquire resource specified by resource locator
*
* @param locator location of the resource needed
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java
index 15d449a632..b54f5127f5 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java
@@ -19,7 +19,6 @@ import org.eclipse.osee.framework.core.exception.OseeNotFoundException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.resource.management.IResource;
-import org.eclipse.osee.framework.resource.management.IResourceListener;
import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceLocatorProvider;
import org.eclipse.osee.framework.resource.management.IResourceManager;
@@ -30,62 +29,14 @@ import org.eclipse.osee.framework.resource.management.IResourceProvider;
*/
public class ResourceManager implements IResourceManager {
- private final Collection<IResourceListener> listeners;
private final Collection<IResourceProvider> resourceProviders;
private final Collection<IResourceLocatorProvider> resourceLocatorProviders;
public ResourceManager() {
- this.listeners = new CopyOnWriteArraySet<IResourceListener>();
this.resourceProviders = new CopyOnWriteArraySet<IResourceProvider>();
this.resourceLocatorProviders = new CopyOnWriteArraySet<IResourceLocatorProvider>();
}
- @Override
- public boolean addResourceListener(IResourceListener listener) {
- return listeners.add(listener);
- }
-
- @Override
- public boolean removeResourceListener(IResourceListener listener) {
- return listeners.remove(listener);
- }
-
- private void notifyPreOnDelete(final IResourceLocator locator) {
- for (IResourceListener listener : listeners) {
- listener.onPreDelete(locator);
- }
- }
-
- private void notifyPostOnDelete(final IResourceLocator locator) {
- for (IResourceListener listener : listeners) {
- listener.onPostDelete(locator);
- }
- }
-
- private void notifyPreOnSave(final IResourceLocator locator, IResource resource, PropertyStore options) {
- for (IResourceListener listener : listeners) {
- listener.onPreSave(locator, resource, options);
- }
- }
-
- private void notifyPostOnSave(IResourceLocator locator, final IResource resource, PropertyStore options) {
- for (IResourceListener listener : listeners) {
- listener.onPostSave(locator, resource, options);
- }
- }
-
- private void notifyPreOnAcquire(final IResourceLocator locator) {
- for (IResourceListener listener : listeners) {
- listener.onPreAcquire(locator);
- }
- }
-
- private void notifyPostOnAcquire(final IResource resource) {
- for (IResourceListener listener : listeners) {
- listener.onPostAcquire(resource);
- }
- }
-
private IResourceProvider getProvider(IResourceLocator locator) throws OseeCoreException {
for (IResourceProvider provider : resourceProviders) {
if (provider.isValid(locator)) {
@@ -108,18 +59,14 @@ public class ResourceManager implements IResourceManager {
@Override
public IResource acquire(IResourceLocator locator, PropertyStore options) throws OseeCoreException {
IResourceProvider provider = getProvider(locator);
- notifyPreOnAcquire(locator);
IResource toReturn = provider.acquire(locator, options);
- notifyPostOnAcquire(toReturn);
return toReturn;
}
@Override
public IResourceLocator save(IResourceLocator locator, IResource resource, PropertyStore options) throws OseeCoreException {
IResourceProvider provider = getProvider(locator);
- notifyPreOnSave(locator, resource, options);
IResourceLocator actualLocator = provider.save(locator, resource, options);
- notifyPostOnSave(locator, resource, options);
return actualLocator;
}
@@ -127,9 +74,7 @@ public class ResourceManager implements IResourceManager {
public int delete(IResourceLocator locator) throws OseeCoreException {
int toReturn = IResourceManager.FAIL;
IResourceProvider provider = getProvider(locator);
- notifyPreOnDelete(locator);
toReturn = provider.delete(locator);
- notifyPostOnDelete(locator);
return toReturn;
}

Back to the top