Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2814 - development/main/depot/station/src/main/net/dpml/depot/station

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2814 - development/main/depot/station/src/main/net/dpml/depot/station
  • Date: Thu, 09 Jun 2005 07:51:46 -0400

Author: mcconnell AT dpml.net
Date: Thu Jun 9 07:51:46 2005
New Revision: 2814

Added:

development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupStorage.java
Modified:

development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupProfile.java
Log:


Modified:
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupProfile.java
==============================================================================
---
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupProfile.java
(original)
+++
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupProfile.java
Thu Jun 9 07:51:46 2005
@@ -39,17 +39,14 @@
public class ActivationGroupProfile extends PluginProfile
{
private String m_classname;
- private ActivationGroupID m_group;
- private boolean m_restart;
private ActivationGroupDesc m_descriptor;

public ActivationGroupProfile(
Logger logger, Date creation, Home home, String id, String title,
- Properties properties, boolean command, Connection connection, URI
uri,
- String classname, boolean restart )
+ Properties properties, URI uri, String classname )
throws ProfileException
{
- super( logger, creation, home, id, title, properties, command,
connection, uri );
+ super( logger, creation, home, id, title, properties, false, null,
uri );

String location = uri.toASCIIString();
Properties props = super.getSystemProperties();
@@ -66,16 +63,6 @@
m_classname = classname;
}

- public boolean getRestartPolicy()
- {
- return m_restart;
- }
-
- public void setResartPolicy( boolean policy )
- {
- m_restart = policy;
- }
-
public ActivationGroupDesc getActivationGroupDesc()
{
return m_descriptor;

Added:
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupStorage.java
==============================================================================
--- (empty file)
+++
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupStorage.java
Thu Jun 9 07:51:46 2005
@@ -0,0 +1,127 @@
+/*
+ * 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.station;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Date;
+import java.util.Properties;
+import java.util.prefs.BackingStoreException;
+import java.util.prefs.Preferences;
+import java.rmi.activation.ActivationGroupID;
+
+import net.dpml.transit.model.Logger;
+import net.dpml.transit.management.Home;
+import net.dpml.transit.management.ModificationEvent;
+import net.dpml.transit.builder.AbstractStorageUnit;
+
+import net.dpml.depot.profile.Profile.Connection;
+import net.dpml.depot.profile.PluginProfile;
+import net.dpml.depot.profile.ProfileException;
+import net.dpml.depot.profile.PluginProfileStorage;
+
+/**
+ * A ProfileHome maintains a persistent application profile.
+ */
+public class ActivationGroupStorage extends PluginProfileStorage
+{
+ //
------------------------------------------------------------------------
+ // state
+ //
------------------------------------------------------------------------
+
+ private final ActivationGroupProfile m_profile;
+
+ //
------------------------------------------------------------------------
+ // constructor
+ //
------------------------------------------------------------------------
+
+ public ActivationGroupStorage(
+ Preferences prefs, Logger logger, Date creation, boolean policy,
+ ActivationGroupID group ) throws ProfileException
+ {
+ super( prefs, logger, creation, policy );
+
+ String id = prefs.name();
+ String title = prefs.get( "title", id );
+ Properties properties = getProperties();
+ URI uri = getPluginURI();
+ String classname = getActivationGroupClassname();
+
+ m_profile =
+ new ActivationGroupProfile(
+ logger, creation, this, id, title, properties, uri, classname );
+ }
+
+ //
------------------------------------------------------------------------
+ // ModificationListener
+ //
------------------------------------------------------------------------
+
+ /**
+ * Notify a listener of a change to the manager modification date.
+ * @param event the modification event
+ */
+ public void modified( ModificationEvent event )
+ {
+ if( getStoragePolicy() )
+ {
+ try
+ {
+ ActivationGroupProfile manager = (ActivationGroupProfile)
event.getManager();
+ Date date = new Date();
+ store( manager );
+ manager.setCreationDate( date );
+ }
+ catch( Throwable e )
+ {
+ getLogger().error( "storage failure", e );
+ }
+ }
+ }
+
+ //
------------------------------------------------------------------------
+ // utils
+ //
------------------------------------------------------------------------
+
+ public ActivationGroupProfile getActivationGroupProfile() throws
ProfileException
+ {
+ return m_profile;
+ }
+
+ protected String getActivationGroupClassname() throws ProfileException
+ {
+ Preferences prefs = getPreferences();
+ String classname = prefs.get( "classname", null );
+ if( null == classname )
+ {
+ final String error =
+ "Activation group profile does not declare the target
classname.";
+ throw new ProfileException( error );
+ }
+ else
+ {
+ return classname;
+ }
+ }
+
+ private void store( ActivationGroupProfile profile )
+ {
+ super.store( profile );
+ throw new UnsupportedOperationException( "store/1" );
+ }
+}



  • svn commit: r2814 - development/main/depot/station/src/main/net/dpml/depot/station, mcconnell, 06/09/2005

Archive powered by MHonArc 2.6.24.

Top of Page