notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2902 - in development/main/depot: console console/src/main/net/dpml/depot console/src/main/net/dpml/depot/profile prefs/src/main/net/dpml/depot/prefs station/src/main/net/dpml/depot/station
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2902 - in development/main/depot: console console/src/main/net/dpml/depot console/src/main/net/dpml/depot/profile prefs/src/main/net/dpml/depot/prefs station/src/main/net/dpml/depot/station
- Date: Wed, 22 Jun 2005 16:02:47 -0400
Author: mcconnell AT dpml.net
Date: Wed Jun 22 16:02:46 2005
New Revision: 2902
Added:
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultDepotProfile.java
Removed:
development/main/depot/console/src/main/net/dpml/depot/profile/Depot.java
Modified:
development/main/depot/console/build.xml
development/main/depot/console/src/main/net/dpml/depot/Main.java
development/main/depot/console/src/main/net/dpml/depot/profile/DepotApplicationEvent.java
development/main/depot/console/src/main/net/dpml/depot/profile/DepotEvent.java
development/main/depot/console/src/main/net/dpml/depot/profile/DepotGroupEvent.java
development/main/depot/console/src/main/net/dpml/depot/profile/DepotProfile.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotModelPanel.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotTableModel.java
development/main/depot/station/src/main/net/dpml/depot/station/DepotStation.java
Log:
Naming improvement.
Modified: development/main/depot/console/build.xml
==============================================================================
--- development/main/depot/console/build.xml (original)
+++ development/main/depot/console/build.xml Wed Jun 22 16:02:46 2005
@@ -28,11 +28,10 @@
<target name="build" depends="standard.build">
<rmic base="${basedir}/target/classes">
<include name="**/DefaultProfile.class"/>
- <include name="**/DefaultProfile.class"/>
<include name="**/DefaultApplicationProfile.class"/>
<include name="**/DefaultActivationProfile.class"/>
<include name="**/DefaultActivationGroupProfile.class"/>
- <include name="**/DepotProfile.class"/>
+ <include name="**/DefaultDepotProfile.class"/>
</rmic>
</target>
Modified: development/main/depot/console/src/main/net/dpml/depot/Main.java
==============================================================================
--- development/main/depot/console/src/main/net/dpml/depot/Main.java
(original)
+++ development/main/depot/console/src/main/net/dpml/depot/Main.java Wed
Jun 22 16:02:46 2005
@@ -57,8 +57,8 @@
import net.dpml.depot.lang.DepotClassLoader;
import net.dpml.depot.profile.ApplicationProfile;
import net.dpml.depot.profile.DefaultApplicationProfile;
-import net.dpml.depot.profile.Depot;
import net.dpml.depot.profile.DepotProfile;
+import net.dpml.depot.profile.DefaultDepotProfile;
import net.dpml.depot.profile.Profile;
import net.dpml.depot.store.DepotHome;
import net.dpml.depot.unit.DepotStorageUnit;
@@ -196,7 +196,7 @@
Logger logger = getLogger();
Preferences prefs = getRootPreferences();
DepotHome store = new DepotStorageUnit( prefs );
- Depot manager = new DepotProfile( logger, store );
+ DepotProfile manager = new DefaultDepotProfile( logger, store );
//
// check for the prefs or station option
@@ -316,7 +316,7 @@
}
private static Object resolveTargetObject(
- ClassLoader parent, URI uri, String[] args, Depot manager,
TransitModel model,
+ ClassLoader parent, URI uri, String[] args, DepotProfile manager,
TransitModel model,
Logger logger, ApplicationProfile profile )
throws Exception
{
@@ -359,7 +359,7 @@
Logger log = logger.getChildLogger( "prefs" );
boolean policy = true;
URI uri = new URI( "@DEPOT-PREFS-URI@" );
- String title = "Depot Preferences";
+ String title = "DepotProfile Preferences";
boolean command = false;
Properties args = new Properties();
return new DefaultApplicationProfile(
@@ -372,7 +372,7 @@
Logger log = logger.getChildLogger( "station" );
boolean policy = true;
URI uri = new URI( "@STATION-PLUGIN-URI@" );
- String title = "Depot Station";
+ String title = "DepotProfile Station";
boolean command = false;
Connection connection = new Connection();
Properties args = new Properties();
@@ -423,7 +423,7 @@
return registry;
}
- private static ApplicationProfile getApplicationProfile( Depot manager,
String target )
+ private static ApplicationProfile getApplicationProfile( DepotProfile
manager, String target )
throws Exception
{
return manager.getApplicationProfile( target );
@@ -573,23 +573,23 @@
private static void handleHelp()
{
final String message =
- "Depot application deployment."
+ "DepotProfile application deployment."
+ "\n\nUsage: depot [-help] | [-version] | [-prefs] | [-get
[artifact]] | [-profile [name]]"
+ "\n\nAvailable command line options:"
+ "\n\n -debug Enable debug level logging."
+ "\n -get [artifact] Load the supplied artifact to the cache."
+ "\n -help List command line help."
- + "\n -prefs Start the Depot preferences editor."
+ + "\n -prefs Start the DepotProfile preferences editor."
+ "\n -profile [name] Launch a named application."
- + "\n -reset Clear Depot and Transit prefences."
- + "\n -version List Depot version information.";
+ + "\n -reset Clear DepotProfile and Transit prefences."
+ + "\n -version List DepotProfile version information.";
getLogger().info( message );
}
private static void handleVersion()
{
final String message =
- "Depot Version.\n"
+ "DepotProfile Version.\n"
+ "\nConsole: \t@DEPOT-CONSOLE-URI@"
+ "\nPreferences: \t@DEPOT-PREFS-URI@"
+ "\nStation: \t@STATION-PLUGIN-URI@";
Added:
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultDepotProfile.java
==============================================================================
--- (empty file)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultDepotProfile.java
Wed Jun 22 16:02:46 2005
@@ -0,0 +1,344 @@
+/*
+ * Copyright 2005 Stephen McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.depot.profile;
+
+import java.net.URI;
+import java.rmi.RemoteException;
+import java.util.Properties;
+import java.util.Date;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.EventListener;
+
+import net.dpml.transit.model.DefaultModel;
+import net.dpml.transit.model.DuplicateKeyException;
+import net.dpml.transit.model.Logger;
+import net.dpml.transit.model.UnknownKeyException;
+
+import net.dpml.depot.store.DepotHome;
+import net.dpml.depot.store.ApplicationStorage;
+import net.dpml.depot.store.ActivationGroupStorage;
+
+/**
+ * Implements of the DepotModel within which a set of application profiles
+ * are maintained.
+ */
+public class DefaultDepotProfile extends DefaultModel implements DepotProfile
+{
+ private final DepotHome m_home;
+
+ private final List m_list = Collections.synchronizedList( new
LinkedList() );
+ private final List m_groups = Collections.synchronizedList( new
LinkedList() );
+
+ public DefaultDepotProfile( Logger logger, DepotHome home )
+ throws NullPointerException, DuplicateKeyException, RemoteException
+ {
+ super( logger );
+
+ m_home = home;
+
+ ApplicationStorage[] stores =
home.getInitialApplicationStorageArray();
+ for( int i=0; i<stores.length; i++ )
+ {
+ ApplicationStorage store = stores[i];
+ addApplicationProfile( store, false );
+ }
+
+ ActivationGroupStorage[] groups =
home.getInitialActivationGroupStorageArray();
+ for( int i=0; i<groups.length; i++ )
+ {
+ ActivationGroupStorage group = groups[i];
+ addActivationGroupProfile( group, false );
+ }
+ }
+
+ public void addApplicationProfile( ApplicationProfile profile )
+ throws DuplicateKeyException, RemoteException
+ {
+ addApplicationProfile( profile, true );
+ }
+
+ public void removeApplicationProfile( ApplicationProfile profile )
throws RemoteException
+ {
+ synchronized( m_lock )
+ {
+ profile.dispose();
+ m_list.remove( profile );
+ ProfileRemovedEvent event = new ProfileRemovedEvent( this,
profile );
+ super.enqueueEvent( event );
+ }
+ }
+
+ public ApplicationProfile[] getApplicationProfiles() throws
RemoteException
+ {
+ synchronized( m_lock )
+ {
+ return (ApplicationProfile[]) m_list.toArray( new
ApplicationProfile[0] );
+ }
+ }
+
+ public ApplicationProfile getApplicationProfile( String key ) throws
UnknownKeyException, RemoteException
+ {
+ ApplicationProfile[] profiles = getApplicationProfiles();
+ for( int i=0; i<profiles.length; i++ )
+ {
+ ApplicationProfile profile = profiles[i];
+ if( key.equals( profile.getID() ) )
+ {
+ return profile;
+ }
+ }
+ throw new UnknownKeyException( key );
+ }
+
+ public void addActivationGroupProfile( ActivationGroupProfile profile )
+ throws DuplicateKeyException, RemoteException
+ {
+ addActivationGroupProfile( profile, true );
+ }
+
+ public void removeActivationGroupProfile( ActivationGroupProfile profile
) throws RemoteException
+ {
+ synchronized( m_lock )
+ {
+ profile.dispose();
+ m_groups.remove( profile );
+ GroupRemovedEvent event = new GroupRemovedEvent( this, profile );
+ super.enqueueEvent( event );
+ }
+ }
+
+ public ActivationGroupProfile[] getActivationGroupProfiles() throws
RemoteException
+ {
+ synchronized( m_lock )
+ {
+ return (ActivationGroupProfile[]) m_groups.toArray( new
ActivationGroupProfile[0] );
+ }
+ }
+
+ public ActivationGroupProfile getActivationGroupProfile( String key )
+ throws UnknownKeyException, RemoteException
+ {
+ ActivationGroupProfile[] profiles = getActivationGroupProfiles();
+ for( int i=0; i<profiles.length; i++ )
+ {
+ ActivationGroupProfile profile = profiles[i];
+ if( key.equals( profile.getID() ) )
+ {
+ return profile;
+ }
+ }
+ throw new UnknownKeyException( key );
+ }
+
+
+ /**
+ * Add a depot content change listener.
+ * @param listener the registry change listener to add
+ */
+ public void addDepotListener( DepotListener listener ) throws
RemoteException
+ {
+ super.addListener( listener );
+ }
+
+ /**
+ * Remove a depot content change listener.
+ * @param listener the registry change listener to remove
+ */
+ public void removeDepotListener( DepotListener listener ) throws
RemoteException
+ {
+ super.removeListener( listener );
+ }
+
+ protected void processEvent( EventObject event )
+ {
+ if( event instanceof DepotApplicationEvent )
+ {
+ processDepotEvent( (DepotEvent) event );
+ }
+ else
+ {
+ super.processEvent( event );
+ }
+ }
+
+ private void addApplicationProfile( ApplicationStorage store, boolean
notify )
+ throws DuplicateKeyException, RemoteException
+ {
+ String id = store.getID();
+ Logger logger = getLogger().getChildLogger( id );
+ ApplicationProfile profile = new DefaultApplicationProfile( logger,
store );
+ addApplicationProfile( profile, notify );
+ }
+
+ private void addApplicationProfile( ApplicationProfile profile, boolean
notify )
+ throws DuplicateKeyException, RemoteException
+ {
+ synchronized( m_lock )
+ {
+ String key = profile.getID();
+ try
+ {
+ ApplicationProfile current = getApplicationProfile( key );
+ throw new DuplicateKeyException( key );
+ }
+ catch( UnknownKeyException e )
+ {
+ m_list.add( profile );
+ if( notify )
+ {
+ ProfileAddedEvent event = new ProfileAddedEvent( this,
profile );
+ enqueueEvent( event );
+ }
+ }
+ }
+ }
+
+ private void addActivationGroupProfile( ActivationGroupStorage store,
boolean notify )
+ throws DuplicateKeyException, RemoteException
+ {
+ String id = store.getID();
+ Logger logger = getLogger().getChildLogger( id );
+ ActivationGroupProfile profile = new DefaultActivationGroupProfile(
logger, store );
+ addActivationGroupProfile( profile, notify );
+ }
+
+ private void addActivationGroupProfile( ActivationGroupProfile profile,
boolean notify )
+ throws DuplicateKeyException, RemoteException
+ {
+ synchronized( m_lock )
+ {
+ String key = profile.getID();
+ try
+ {
+ ActivationGroupProfile current = getActivationGroupProfile(
key );
+ throw new DuplicateKeyException( key );
+ }
+ catch( UnknownKeyException e )
+ {
+ m_groups.add( profile );
+ if( notify )
+ {
+ GroupAddedEvent event = new GroupAddedEvent( this,
profile );
+ enqueueEvent( event );
+ }
+ }
+ }
+ }
+
+ private void processDepotEvent( DepotEvent event )
+ {
+ EventListener[] listeners = super.listeners();
+ for( int i=0; i<listeners.length; i++ )
+ {
+ EventListener listener = listeners[i];
+ if( listener instanceof DepotListener )
+ {
+ DepotListener rl = (DepotListener) listener;
+ if( event instanceof ProfileAddedEvent )
+ {
+ try
+ {
+ rl.profileAdded( (DepotApplicationEvent) event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "DepotListener profile addition notification
error.";
+ getLogger().error( error, e );
+ }
+ }
+ else if( event instanceof ProfileRemovedEvent )
+ {
+ try
+ {
+ rl.profileRemoved( (DepotApplicationEvent) event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "DepotListener profile removed notification
error.";
+ getLogger().error( error, e );
+ }
+ }
+ else if( event instanceof GroupAddedEvent )
+ {
+ try
+ {
+ rl.groupAdded( (DepotGroupEvent) event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "DepotListener group addition notification error.";
+ getLogger().error( error, e );
+ }
+ }
+ else if( event instanceof GroupRemovedEvent )
+ {
+ try
+ {
+ rl.groupRemoved( (DepotGroupEvent) event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "DepotListener group removal notification error.";
+ getLogger().error( error, e );
+ }
+ }
+ }
+ }
+ }
+
+ static class ProfileAddedEvent extends DepotApplicationEvent
+ {
+ public ProfileAddedEvent( DepotProfile source, ApplicationProfile
profile )
+ {
+ super( source, profile );
+ }
+ }
+
+ static class ProfileRemovedEvent extends DepotApplicationEvent
+ {
+ public ProfileRemovedEvent( DepotProfile source, ApplicationProfile
profile )
+ {
+ super( source, profile );
+ }
+ }
+
+ static class GroupAddedEvent extends DepotGroupEvent
+ {
+ public GroupAddedEvent( DepotProfile source, ActivationGroupProfile
profile )
+ {
+ super( source, profile );
+ }
+ }
+
+ static class GroupRemovedEvent extends DepotGroupEvent
+ {
+ public GroupRemovedEvent( DepotProfile source,
ActivationGroupProfile profile )
+ {
+ super( source, profile );
+ }
+ }
+
+}
Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DepotApplicationEvent.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DepotApplicationEvent.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DepotApplicationEvent.java
Wed Jun 22 16:02:46 2005
@@ -27,7 +27,7 @@
{
ApplicationProfile m_profile;
- public DepotApplicationEvent( Depot model, ApplicationProfile profile )
+ public DepotApplicationEvent( DepotProfile model, ApplicationProfile
profile )
{
super( model );
m_profile = profile;
Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DepotEvent.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DepotEvent.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DepotEvent.java
Wed Jun 22 16:02:46 2005
@@ -25,13 +25,13 @@
*/
public abstract class DepotEvent extends EventObject
{
- public DepotEvent( Depot model )
+ public DepotEvent( DepotProfile model )
{
super( model );
}
- public Depot getDepotModel()
+ public DepotProfile getDepotProfile()
{
- return (Depot) super.getSource();
+ return (DepotProfile) super.getSource();
}
}
Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DepotGroupEvent.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DepotGroupEvent.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DepotGroupEvent.java
Wed Jun 22 16:02:46 2005
@@ -27,7 +27,7 @@
{
ActivationGroupProfile m_profile;
- public DepotGroupEvent( Depot model, ActivationGroupProfile profile )
+ public DepotGroupEvent( DepotProfile model, ActivationGroupProfile
profile )
{
super( model );
m_profile = profile;
Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DepotProfile.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DepotProfile.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DepotProfile.java
Wed Jun 22 16:02:46 2005
@@ -18,327 +18,46 @@
package net.dpml.depot.profile;
-import java.net.URI;
import java.rmi.RemoteException;
-import java.util.Properties;
-import java.util.Date;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Collections;
-import java.util.EventObject;
-import java.util.EventListener;
-import net.dpml.transit.model.DefaultModel;
+import net.dpml.transit.model.Model;
import net.dpml.transit.model.DuplicateKeyException;
-import net.dpml.transit.model.Logger;
import net.dpml.transit.model.UnknownKeyException;
-import net.dpml.depot.store.DepotHome;
-import net.dpml.depot.store.ApplicationStorage;
-import net.dpml.depot.store.ActivationGroupStorage;
-
/**
- * Implements of the DepotModel within which a set of application profiles
- * are maintained.
+ *
*/
-public class DepotProfile extends DefaultModel implements Depot
+public interface DepotProfile extends Model
{
- private final DepotHome m_home;
+ ApplicationProfile[] getApplicationProfiles() throws RemoteException;
+
+ ApplicationProfile getApplicationProfile( String key ) throws
UnknownKeyException, RemoteException;
+
+ void addActivationGroupProfile( ActivationGroupProfile profile )
+ throws DuplicateKeyException, RemoteException;
- private final List m_list = Collections.synchronizedList( new
LinkedList() );
- private final List m_groups = Collections.synchronizedList( new
LinkedList() );
+ void removeActivationGroupProfile( ActivationGroupProfile profile )
throws RemoteException;
- public DepotProfile( Logger logger, DepotHome home )
- throws NullPointerException, DuplicateKeyException, RemoteException
- {
- super( logger );
-
- m_home = home;
-
- ApplicationStorage[] stores =
home.getInitialApplicationStorageArray();
- for( int i=0; i<stores.length; i++ )
- {
- ApplicationStorage store = stores[i];
- addApplicationProfile( store, false );
- }
-
- ActivationGroupStorage[] groups =
home.getInitialActivationGroupStorageArray();
- for( int i=0; i<groups.length; i++ )
- {
- ActivationGroupStorage group = groups[i];
- addActivationGroupProfile( group, false );
- }
- }
-
- public void addApplicationProfile( ApplicationProfile profile )
- throws DuplicateKeyException, RemoteException
- {
- addApplicationProfile( profile, true );
- }
-
- public void removeApplicationProfile( ApplicationProfile profile )
throws RemoteException
- {
- synchronized( m_lock )
- {
- profile.dispose();
- m_list.remove( profile );
- ProfileRemovedEvent event = new ProfileRemovedEvent( this,
profile );
- super.enqueueEvent( event );
- }
- }
-
- public ApplicationProfile[] getApplicationProfiles() throws
RemoteException
- {
- synchronized( m_lock )
- {
- return (ApplicationProfile[]) m_list.toArray( new
ApplicationProfile[0] );
- }
- }
-
- public ApplicationProfile getApplicationProfile( String key ) throws
UnknownKeyException, RemoteException
- {
- ApplicationProfile[] profiles = getApplicationProfiles();
- for( int i=0; i<profiles.length; i++ )
- {
- ApplicationProfile profile = profiles[i];
- if( key.equals( profile.getID() ) )
- {
- return profile;
- }
- }
- throw new UnknownKeyException( key );
- }
-
- public void addActivationGroupProfile( ActivationGroupProfile profile )
- throws DuplicateKeyException, RemoteException
- {
- addActivationGroupProfile( profile, true );
- }
-
- public void removeActivationGroupProfile( ActivationGroupProfile profile
) throws RemoteException
- {
- synchronized( m_lock )
- {
- profile.dispose();
- m_groups.remove( profile );
- GroupRemovedEvent event = new GroupRemovedEvent( this, profile );
- super.enqueueEvent( event );
- }
- }
-
- public ActivationGroupProfile[] getActivationGroupProfiles() throws
RemoteException
- {
- synchronized( m_lock )
- {
- return (ActivationGroupProfile[]) m_groups.toArray( new
ActivationGroupProfile[0] );
- }
- }
-
- public ActivationGroupProfile getActivationGroupProfile( String key )
- throws UnknownKeyException, RemoteException
- {
- ActivationGroupProfile[] profiles = getActivationGroupProfiles();
- for( int i=0; i<profiles.length; i++ )
- {
- ActivationGroupProfile profile = profiles[i];
- if( key.equals( profile.getID() ) )
- {
- return profile;
- }
- }
- throw new UnknownKeyException( key );
- }
+ ActivationGroupProfile[] getActivationGroupProfiles() throws
RemoteException;
+ ActivationGroupProfile getActivationGroupProfile( String key ) throws
UnknownKeyException, RemoteException;
/**
* Add a depot content change listener.
* @param listener the registry change listener to add
*/
- public void addDepotListener( DepotListener listener ) throws
RemoteException
- {
- super.addListener( listener );
- }
+ void addDepotListener( DepotListener listener ) throws RemoteException;
/**
* Remove a depot content change listener.
* @param listener the registry change listener to remove
*/
- public void removeDepotListener( DepotListener listener ) throws
RemoteException
- {
- super.removeListener( listener );
- }
-
- protected void processEvent( EventObject event )
- {
- if( event instanceof DepotApplicationEvent )
- {
- processDepotEvent( (DepotEvent) event );
- }
- else
- {
- super.processEvent( event );
- }
- }
-
- private void addApplicationProfile( ApplicationStorage store, boolean
notify )
- throws DuplicateKeyException, RemoteException
- {
- String id = store.getID();
- Logger logger = getLogger().getChildLogger( id );
- ApplicationProfile profile = new DefaultApplicationProfile( logger,
store );
- addApplicationProfile( profile, notify );
- }
-
- private void addApplicationProfile( ApplicationProfile profile, boolean
notify )
- throws DuplicateKeyException, RemoteException
- {
- synchronized( m_lock )
- {
- String key = profile.getID();
- try
- {
- ApplicationProfile current = getApplicationProfile( key );
- throw new DuplicateKeyException( key );
- }
- catch( UnknownKeyException e )
- {
- m_list.add( profile );
- if( notify )
- {
- ProfileAddedEvent event = new ProfileAddedEvent( this,
profile );
- enqueueEvent( event );
- }
- }
- }
- }
-
- private void addActivationGroupProfile( ActivationGroupStorage store,
boolean notify )
- throws DuplicateKeyException, RemoteException
- {
- String id = store.getID();
- Logger logger = getLogger().getChildLogger( id );
- ActivationGroupProfile profile = new DefaultActivationGroupProfile(
logger, store );
- addActivationGroupProfile( profile, notify );
- }
-
- private void addActivationGroupProfile( ActivationGroupProfile profile,
boolean notify )
- throws DuplicateKeyException, RemoteException
- {
- synchronized( m_lock )
- {
- String key = profile.getID();
- try
- {
- ActivationGroupProfile current = getActivationGroupProfile(
key );
- throw new DuplicateKeyException( key );
- }
- catch( UnknownKeyException e )
- {
- m_groups.add( profile );
- if( notify )
- {
- GroupAddedEvent event = new GroupAddedEvent( this,
profile );
- enqueueEvent( event );
- }
- }
- }
- }
-
- private void processDepotEvent( DepotEvent event )
- {
- EventListener[] listeners = super.listeners();
- for( int i=0; i<listeners.length; i++ )
- {
- EventListener listener = listeners[i];
- if( listener instanceof DepotListener )
- {
- DepotListener rl = (DepotListener) listener;
- if( event instanceof ProfileAddedEvent )
- {
- try
- {
- rl.profileAdded( (DepotApplicationEvent) event );
- }
- catch( Throwable e )
- {
- final String error =
- "DepotListener profile addition notification
error.";
- getLogger().error( error, e );
- }
- }
- else if( event instanceof ProfileRemovedEvent )
- {
- try
- {
- rl.profileRemoved( (DepotApplicationEvent) event );
- }
- catch( Throwable e )
- {
- final String error =
- "DepotListener profile removed notification
error.";
- getLogger().error( error, e );
- }
- }
- else if( event instanceof GroupAddedEvent )
- {
- try
- {
- rl.groupAdded( (DepotGroupEvent) event );
- }
- catch( Throwable e )
- {
- final String error =
- "DepotListener group addition notification error.";
- getLogger().error( error, e );
- }
- }
- else if( event instanceof GroupRemovedEvent )
- {
- try
- {
- rl.groupRemoved( (DepotGroupEvent) event );
- }
- catch( Throwable e )
- {
- final String error =
- "DepotListener group removal notification error.";
- getLogger().error( error, e );
- }
- }
- }
- }
- }
-
- static class ProfileAddedEvent extends DepotApplicationEvent
- {
- public ProfileAddedEvent( Depot source, ApplicationProfile profile )
- {
- super( source, profile );
- }
- }
-
- static class ProfileRemovedEvent extends DepotApplicationEvent
- {
- public ProfileRemovedEvent( Depot source, ApplicationProfile profile
)
- {
- super( source, profile );
- }
- }
-
- static class GroupAddedEvent extends DepotGroupEvent
- {
- public GroupAddedEvent( Depot source, ActivationGroupProfile profile
)
- {
- super( source, profile );
- }
- }
-
- static class GroupRemovedEvent extends DepotGroupEvent
- {
- public GroupRemovedEvent( Depot source, ActivationGroupProfile
profile )
- {
- super( source, profile );
- }
- }
+ void removeDepotListener( DepotListener listener ) throws
RemoteException;
+
+ void addApplicationProfile( ApplicationProfile profile )
+ throws DuplicateKeyException, RemoteException;
+
+ void removeApplicationProfile( ApplicationProfile profile ) throws
RemoteException;
}
+
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotModelPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotModelPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotModelPanel.java
Wed Jun 22 16:02:46 2005
@@ -48,7 +48,7 @@
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
-import net.dpml.depot.profile.Depot;
+import net.dpml.depot.profile.DepotProfile;
import net.dpml.depot.profile.ApplicationProfile;
import net.dpml.transit.model.DuplicateKeyException;
@@ -73,14 +73,14 @@
private JButton m_delete;
private String m_selection;
- private Depot m_model;
+ private DepotProfile m_model;
private DepotTableModel m_tableModel;
//--------------------------------------------------------------
// constructor
//--------------------------------------------------------------
- public DepotModelPanel( Window parent, Depot model ) throws Exception
+ public DepotModelPanel( Window parent, DepotProfile model ) throws
Exception
{
super();
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
Wed Jun 22 16:02:46 2005
@@ -38,7 +38,7 @@
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
-import net.dpml.depot.profile.Depot;
+import net.dpml.depot.profile.DepotProfile;
import net.dpml.transit.Transit;
import net.dpml.transit.model.TransitModel;
@@ -75,14 +75,14 @@
*/
private static final int ZERO = 0;
- public DepotPreferencesFrame( TransitModel model, Depot depot ) throws
Exception
+ public DepotPreferencesFrame( TransitModel model, DepotProfile depot )
throws Exception
{
super();
String classname = UIManager.getSystemLookAndFeelClassName();
UIManager.setLookAndFeel( classname );
- setTitle( "DPML Depot" );
+ setTitle( "DPML DepotProfile" );
Dimension size = new Dimension( DEFAULT_DIALOG_WIDTH,
DEFAULT_DIALOG_HEIGHT );
setSize( size );
DepotPreferencesPanel panel = new DepotPreferencesPanel( this,
model, depot );
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
Wed Jun 22 16:02:46 2005
@@ -48,7 +48,7 @@
import net.dpml.transit.model.ContentRegistryModel;
import net.dpml.transit.model.ProxyModel;
-import net.dpml.depot.profile.Depot;
+import net.dpml.depot.profile.DepotProfile;
/**
* Panel that presents the default preferences for DPML applications
including
@@ -87,10 +87,10 @@
private DepotModelPanel m_depotPanel;
private final Window m_window;
- private final Depot m_depot;
+ private final DepotProfile m_depot;
public DepotPreferencesPanel(
- Window window, final TransitModel model, final Depot depot ) throws
Exception
+ Window window, final TransitModel model, final DepotProfile depot )
throws Exception
{
super( new BorderLayout() );
@@ -100,7 +100,7 @@
JLabel label =
IconHelper.createImageIconJLabel(
- getClass().getClassLoader(), DPML_ICON_FILENAME, "", "DPML
Depot" );
+ getClass().getClassLoader(), DPML_ICON_FILENAME, "", "DPML
DepotProfile" );
label.setBorder( new EmptyBorder( 5, 0, 0, 0 ) );
final JTabbedPane tabbedPane = new JTabbedPane();
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotTableModel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotTableModel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotTableModel.java
Wed Jun 22 16:02:46 2005
@@ -26,7 +26,7 @@
import net.dpml.depot.profile.DepotApplicationEvent;
import net.dpml.depot.profile.DepotGroupEvent;
import net.dpml.depot.profile.DepotListener;
-import net.dpml.depot.profile.Depot;
+import net.dpml.depot.profile.DepotProfile;
/**
* Table model that maps table rows to child nodes of a supplied preferences
node.
@@ -64,7 +64,7 @@
IconHelper.createImageIcon(
DepotTableModel.class.getClassLoader(), ICON_PATH, "Features" );
- private final Depot m_model;
+ private final DepotProfile m_model;
private final RemoteListener m_listener;
//--------------------------------------------------------------------------
@@ -77,7 +77,7 @@
*
* @param model the registry of application profiles
*/
- public DepotTableModel( Depot model ) throws Exception
+ public DepotTableModel( DepotProfile model ) throws Exception
{
super();
m_model = model;
Modified:
development/main/depot/station/src/main/net/dpml/depot/station/DepotStation.java
==============================================================================
---
development/main/depot/station/src/main/net/dpml/depot/station/DepotStation.java
(original)
+++
development/main/depot/station/src/main/net/dpml/depot/station/DepotStation.java
Wed Jun 22 16:02:46 2005
@@ -27,7 +27,7 @@
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.model.Connection;
-import net.dpml.depot.profile.Depot;
+import net.dpml.depot.profile.DepotProfile;
import net.dpml.depot.profile.ProfileException;
import net.dpml.depot.profile.ActivationProfile;
import net.dpml.depot.profile.ActivationGroupProfile;
@@ -38,11 +38,11 @@
private final Logger m_logger;
private Hashtable m_table = new Hashtable();
- private Depot m_model;
+ private DepotProfile m_model;
private ActivationGroupID m_rootID;
- public DepotStation( Logger logger, Depot model ) throws RemoteException
+ public DepotStation( Logger logger, DepotProfile model ) throws
RemoteException
{
super();
- svn commit: r2902 - in development/main/depot: console console/src/main/net/dpml/depot console/src/main/net/dpml/depot/profile prefs/src/main/net/dpml/depot/prefs station/src/main/net/dpml/depot/station, mcconnell, 06/22/2005
Archive powered by MHonArc 2.6.24.