Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1444 - in development/laboratory/planet/industry/industrial-automation: parts/alarm/src/main/net/dpml/ia/parts/alarm services/alarm/src/main/net/dpml/ia/alarm

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1444 - in development/laboratory/planet/industry/industrial-automation: parts/alarm/src/main/net/dpml/ia/parts/alarm services/alarm/src/main/net/dpml/ia/alarm
  • Date: Mon, 10 Jan 2005 18:32:24 +0100

Author: niclas
Date: Mon Jan 10 18:32:24 2005
New Revision: 1444

Modified:

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AcknowledgeEvent.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/ActivationEvent.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmHistoryImpl.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmImpl.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmModelImpl.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmServiceImpl.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/DeactivationEvent.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/GenericAlarmEvent.java

development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/StandardModelProvider.java

development/laboratory/planet/industry/industrial-automation/services/alarm/src/main/net/dpml/ia/alarm/AlarmService.java
Log:
Mostly formatting...

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AcknowledgeEvent.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AcknowledgeEvent.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AcknowledgeEvent.java
Mon Jan 10 18:32:24 2005
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 1996-2003 Bali Automation. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
@@ -7,31 +7,30 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

package net.dpml.ia.parts.alarm;

import net.dpml.ia.alarm.Alarm;
-import net.dpml.ia.alarm.AlarmEvent;
import net.dpml.ia.alarm.AlarmState;

public final class AcknowledgeEvent extends GenericAlarmEvent
{
static final long serialVersionUID = 2L;

- public AcknowledgeEvent( Object triggedBy, Alarm alarm,
+ public AcknowledgeEvent( Object triggedBy, Alarm alarm,
AlarmState oldstate, AlarmState newstate, long
time )
{
super(triggedBy, alarm, oldstate, newstate, time );
}
-
+
public String toString()
{
return super.toString() + ", event( acknowledge )";
@@ -41,5 +40,5 @@
{
return "EVENT_ACKNOWLEDGE";
}
-
+
}

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/ActivationEvent.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/ActivationEvent.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/ActivationEvent.java
Mon Jan 10 18:32:24 2005
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 1996-2003 Bali Automation. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
@@ -7,31 +7,30 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

package net.dpml.ia.parts.alarm;

import net.dpml.ia.alarm.Alarm;
-import net.dpml.ia.alarm.AlarmEvent;
import net.dpml.ia.alarm.AlarmState;

public final class ActivationEvent extends GenericAlarmEvent
{
static final long serialVersionUID = 2L;

- public ActivationEvent( Object triggedBy, Alarm alarm,
+ public ActivationEvent( Object triggedBy, Alarm alarm,
AlarmState oldstate, AlarmState newstate, long
time )
{
super(triggedBy, alarm, oldstate, newstate, time );
}
-
+
public String toString()
{
return super.toString() + ", event( activate )";
@@ -41,5 +40,5 @@
{
return "EVENT_ACTIVATION";
}
-
+
}

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmHistoryImpl.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmHistoryImpl.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmHistoryImpl.java
Mon Jan 10 18:32:24 2005
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 1996-2003 Bali Automation. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
@@ -7,12 +7,12 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

@@ -22,8 +22,8 @@
import net.dpml.ia.alarm.AlarmHistory;

import java.util.ArrayList;
-import java.util.Iterator;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;

@@ -31,17 +31,17 @@
implements java.io.Serializable, AlarmHistory
{
static final long serialVersionUID = 2L;
-
+
private ArrayList m_List;
private int m_MaxSize = 30;
private HashMap m_Counters;
-
+
public AlarmHistoryImpl()
{
m_List = new ArrayList();
m_Counters = new HashMap();
}
-
+
public AlarmEvent getFirst()
{
synchronized(m_List)
@@ -61,7 +61,7 @@
return (AlarmEvent) m_List.get(m_List.size()-1);
}
}
-
+
public AlarmEvent getAt( final int position )
{
synchronized( this )
@@ -71,7 +71,7 @@
return (AlarmEvent) m_List.get(position);
}
}
-
+
public AlarmEvent getAtFromLast( final int position )
{
AlarmEvent event = null;
@@ -83,7 +83,7 @@
}
return event;
}
-
+
public void addEvent( final AlarmEvent event, final String trigger )
{
synchronized( this )
@@ -98,18 +98,18 @@
m_Counters.put( trigger, counter );
}
}
-
+
synchronized public void setMaxSize( final int size )
{
m_MaxSize = size;
purge();
}
-
+
synchronized public int getMaxSize()
{
return m_MaxSize;
}
-
+
public String toString()
{
synchronized(m_List)
@@ -127,7 +127,7 @@
return buf.toString();
}
}
-
+
synchronized protected void purge()
{
if( m_MaxSize <= 0 )
@@ -143,7 +143,7 @@
{
return m_List;
}
-
+
public Map getCounters()
{
return m_Counters;
@@ -153,12 +153,12 @@
{
m_Counters.clear();
}
-
+
public int getActivateCounter()
{
return ((Integer) m_Counters.get( "activate" )).intValue();
}
-
+
public void resetActivateCounter()
{
m_Counters.remove( "activate" );

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmImpl.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmImpl.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmImpl.java
Mon Jan 10 18:32:24 2005
@@ -7,12 +7,12 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

@@ -43,7 +43,7 @@
private AlarmState m_State;
private AlarmHistoryImpl m_History;
private String m_Name;
-
+
private Map m_Properties;
private ArrayList m_Listeners = null;

@@ -66,17 +66,17 @@
{
m_State = new NormalState();
}
-
+
public AlarmModel getAlarmModel()
{
return m_Model;
}
-
+
public void setAlarmModel( AlarmModel model )
{
m_Model = model;
}
-
+
public void setProperty( String name, Object value )
{
if( value == null )
@@ -94,7 +94,7 @@
{
return m_Properties;
}
-
+
public synchronized void addAlarmListener( AlarmListener listener )
{
synchronized( this )
@@ -149,7 +149,7 @@
public void trigger( Object source, String trigger )
throws AlarmTriggerException
{
- AlarmEvent event = null;
+ AlarmEvent event;
synchronized( this )
{
event = m_Model.getAlarmModelProvider().executeStateChange(
source, this, trigger );
@@ -206,7 +206,7 @@
{
return m_Name;
}
-
+
/** Returns a Description of the Alarm.
* This normally returns a full Description of the Alarm in the
* default Locale.
@@ -215,7 +215,7 @@
{
return getDescription( null );
}
-
+
/** Returns a Description of the Alarm.
* This normally returns a full Description of the Alarm in the
* Locale. If Locale is <code><b>null</b></code>, then the

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmModelImpl.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmModelImpl.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmModelImpl.java
Mon Jan 10 18:32:24 2005
@@ -7,12 +7,12 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

@@ -22,18 +22,14 @@
import net.dpml.ia.alarm.AlarmCreationException;
import net.dpml.ia.alarm.AlarmListener;
import net.dpml.ia.alarm.AlarmModel;
-import net.dpml.ia.alarm.AlarmService;
-
import net.dpml.ia.alarm.AlarmModelProvider;
-
-import net.dpml.parameters.Parameters;
+import net.dpml.ia.alarm.AlarmService;
import net.dpml.parameters.ParameterException;
-
+import net.dpml.parameters.Parameters;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;

import java.lang.ref.WeakReference;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -48,16 +44,16 @@
*/
public class AlarmModelImpl
implements AlarmModel
-{
+{
private AlarmModelProvider m_Provider;
private ArrayList m_Listeners;
private HashMap m_Properties;
private HashMap m_Alarms;
-
+
/**
- * @metro.dependency type="net.dpml.ia.alarm.AlarmService"
+ * @metro.dependency type="net.dpml.ia.alarm.AlarmService"
* key="service"
- * @metro.dependency type="net.dpml.ia.alarm.AlarmModelProvider"
+ * @metro.dependency type="net.dpml.ia.alarm.AlarmModelProvider"
* key="provider"
*/
public AlarmModelImpl( ServiceManager man, Parameters params )
@@ -65,18 +61,18 @@
{
m_Alarms = new HashMap();
m_Properties = new HashMap();
-
+
boolean isDefault = params.getParameterAsBoolean(
"default-provider", false );
-
+
AlarmModelProvider provider = (AlarmModelProvider) man.lookup(
"provider" );
m_Provider = provider;
-
+
AlarmService service = (AlarmService) man.lookup( "service" );
service.addAlarmModel( this );
if( isDefault )
service.setDefaultAlarmModel( this );
}
-
+
/** This constructor is used for testcases only.
*/
AlarmModelImpl( AlarmModelProvider provider )
@@ -104,30 +100,30 @@
{
m_Alarms.put( new WeakReference( alarm ), new Date() );
}
-
+
public String getName()
{
return m_Provider.getName();
}
-
+
public String getDescription()
{
return getDescription( null );
}
-
+
public String getDescription( Locale locale )
{
return m_Provider.getDescription( locale );
}
-
- public Alarm createAlarm( String name )
+
+ public Alarm createAlarm( String name )
throws AlarmCreationException
{
Alarm alarm = new AlarmImpl( this, name );
registerAlarm( alarm );
return alarm;
}
-
+
public Collection getAlarms()
{
ArrayList result = new ArrayList();
@@ -140,17 +136,17 @@
}
return result;
}
-
+
public String[] getAlarmTriggers()
{
return m_Provider.getAlarmTriggers();
}
-
+
public AlarmModelProvider getAlarmModelProvider()
{
return m_Provider;
}
-
+
/** Register AlarmListener to recieve <code>AlarmEvents</code> from all
* <code>Alarms</code> managed by this <code>AlarmModel</code>.
*/
@@ -181,14 +177,14 @@
m_Listeners = v;
}
}
-
+
public Collection getAlarmListeners()
{
if( m_Listeners == null )
return new ArrayList();
return m_Listeners;
}
-
+
/** Adds a new <i>Property</i> to <strong>all</strong>
<code>Alarms</code>.
* The <code>defaultvalue</code> will be added to all present and future
* <code>Alarms</code> created through this AlarmModel. In case any
existing
@@ -199,14 +195,14 @@
{
m_Properties.put( name, defaultValue );
}
-
+
/** Removes the <i>Property</i> from all <code>Alarms</code>.
*/
public void removeProperty( String name )
{
m_Properties.remove( name );
}
-
+
/** Returns a <code>java.util.Map</code> of all global default
<i>Properties</i>.
*/
public Map getDefaultProperties()

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmServiceImpl.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmServiceImpl.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/AlarmServiceImpl.java
Mon Jan 10 18:32:24 2005
@@ -7,12 +7,12 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

@@ -21,17 +21,14 @@
import net.dpml.ia.alarm.Alarm;
import net.dpml.ia.alarm.AlarmCreationException;
import net.dpml.ia.alarm.AlarmEvent;
-import net.dpml.ia.alarm.AlarmService;
import net.dpml.ia.alarm.AlarmListener;
import net.dpml.ia.alarm.AlarmModel;
+import net.dpml.ia.alarm.AlarmService;
+import net.dpml.logging.AbstractLogEnabled;

import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Iterator;
-import java.util.Map;
-
-import net.dpml.logging.AbstractLogEnabled;

/** AlarmService implementation.
*
@@ -44,12 +41,12 @@
private ArrayList m_AlarmListeners;
private ArrayList m_Models;
private AlarmModel m_DefaultModel;
-
+
public AlarmServiceImpl()
{
m_Models = new ArrayList();
}
-
+
/** Returns all the AlarmModels that has been installed.
**/
public AlarmModel[] getAlarmModels()
@@ -61,14 +58,14 @@
return am;
}
}
-
+
/** Returns the default AlarmModel.
**/
public AlarmModel getDefaultAlarmModel()
{
return m_DefaultModel;
}
-
+
/** Sets the default AlarmModel.
* Changes the default AlarmModel. All Alarms belonging
* to the old default AlarmModel will be re-assigned to the
@@ -85,15 +82,15 @@
m_DefaultModel = model;
}
}
-
+
/** Creates an Alarm with the default AlarmModel.
- **/
- public Alarm createAlarm( String name )
+ **/
+ public Alarm createAlarm( String name )
throws AlarmCreationException
{
return getDefaultAlarmModel().createAlarm( name );
}
-
+
/** Register AlarmListener to recieve <code>AlarmEvents</code> from all
* <code>Alarms</code> managed by this <code>AlarmService</code>.
*/
@@ -155,7 +152,7 @@
}
}
}
-
+
public void addAlarmModel( AlarmModel model )
{
m_Models.add( model );
@@ -165,4 +162,4 @@
{
m_Models.remove( model );
}
-}
+}

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/DeactivationEvent.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/DeactivationEvent.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/DeactivationEvent.java
Mon Jan 10 18:32:24 2005
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 1996-2003 Bali Automation. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
@@ -7,31 +7,30 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

package net.dpml.ia.parts.alarm;

import net.dpml.ia.alarm.Alarm;
-import net.dpml.ia.alarm.AlarmEvent;
import net.dpml.ia.alarm.AlarmState;

public final class DeactivationEvent extends GenericAlarmEvent
{
static final long serialVersionUID = 2L;

- public DeactivationEvent( Object triggedBy, Alarm alarm,
+ public DeactivationEvent( Object triggedBy, Alarm alarm,
AlarmState oldstate, AlarmState newstate, long
time )
{
super(triggedBy, alarm, oldstate, newstate, time );
}
-
+
public String toString()
{
return super.toString() + ", event[ deactivate ]";
@@ -41,5 +40,5 @@
{
return "EVENT_DEACTIVATION";
}
-
+
}

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/GenericAlarmEvent.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/GenericAlarmEvent.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/GenericAlarmEvent.java
Mon Jan 10 18:32:24 2005
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 1996-2003 Bali Automation. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
@@ -7,23 +7,23 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

package net.dpml.ia.parts.alarm;

-import net.dpml.ia.alarm.AlarmState;
import net.dpml.ia.alarm.Alarm;
import net.dpml.ia.alarm.AlarmEvent;
+import net.dpml.ia.alarm.AlarmState;

-import java.util.EventObject;
import java.util.Date;
+import java.util.EventObject;
import java.util.Locale;
import java.util.ResourceBundle;

@@ -36,11 +36,11 @@
private AlarmState m_OldState;
private AlarmState m_NewState;
private Date m_EventTime;
-
+
public GenericAlarmEvent( Object triggeredBy,
- Alarm source,
- AlarmState oldstate,
- AlarmState newstate,
+ Alarm source,
+ AlarmState oldstate,
+ AlarmState newstate,
long time )
{
super(source);
@@ -50,42 +50,42 @@
m_EventTime = new Date(time);
}

-
+
public Object getTriggeredBy()
{
return m_TriggeredBy;
}
-
+
public Alarm getAlarm()
{
return (Alarm) super.getSource();
}
-
+
public AlarmState getOldState()
{
return m_OldState;
}
-
+
public AlarmState getNewState()
{
return m_NewState;
}
-
+
public Date getEventTime()
{
return m_EventTime;
}
-
+
public String toString()
{
- return super.getSource().toString()
- + ", time[" + m_EventTime.toString()
- + "], oldstate[" + m_OldState.toString()
+ return super.getSource().toString()
+ + ", time[" + m_EventTime.toString()
+ + "], oldstate[" + m_OldState.toString()
+ "], newstate[" + m_NewState.toString() + "]";
}

protected abstract String getResourceHead();
-
+
/** Returns the Name of the event.
* This normally returns the human readable name of the Event, such as
* activate, deactivate and acknowledge, in the default locale.
@@ -111,13 +111,13 @@
* This normally returns a brief description of the event type, but
could/should
* allow for Alarm specific descriptions for humans to be better
informed.
* The description is returned in the default Locale.
- * @see #getDescription( Locale locale )
+ * @see #getDescription( Locale locale )
*/
public String getDescription()
{
return getDescription( null );
}
-
+
/** Returns a Description of the event in the specified locale.
* This normally returns a brief description of the event type, but
could/should
* allow for Alarm specific descriptions for humans to be better
informed.
@@ -129,5 +129,5 @@
ResourceBundle rb = ResourceBundle.getBundle(
"net.dpml.ia.parts.alarm.AlarmResources", locale );
return rb.getString( getResourceHead() + "_DESCRIPTION" );
}
-
+
}

Modified:
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/StandardModelProvider.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/StandardModelProvider.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/parts/alarm/src/main/net/dpml/ia/parts/alarm/StandardModelProvider.java
Mon Jan 10 18:32:24 2005
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 1996-2003 Bali Automation. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
@@ -7,51 +7,49 @@
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
- * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
- * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/

package net.dpml.ia.parts.alarm;

import net.dpml.ia.alarm.Alarm;
-import net.dpml.ia.alarm.AlarmCreationException;
import net.dpml.ia.alarm.AlarmEvent;
+import net.dpml.ia.alarm.AlarmModelProvider;
import net.dpml.ia.alarm.AlarmState;
import net.dpml.ia.alarm.AlarmTriggerException;

-import net.dpml.ia.alarm.AlarmModelProvider;
-
import java.util.Locale;
import java.util.ResourceBundle;

public class StandardModelProvider
- implements AlarmModelProvider
+ implements AlarmModelProvider
{
private final String ALARM_ACTIVATE = "activate";
private final String ALARM_DEACTIVATE = "deactivate";
private final String ALARM_ACKNOWLEDGE = "acknowledge";
- private final String[] ALARM_TYPES =
+ private final String[] ALARM_TYPES =
{
ALARM_ACTIVATE, ALARM_DEACTIVATE, ALARM_ACKNOWLEDGE
};

/** Returns the Name of the AlarmModel.
- * This normally returns the human readable technical name of
+ * This normally returns the human readable technical name of
* the AlarmModel.
*/
public String getName()
{
return "net.dpml.ia.alarm.model.standard";
}
-
+
/** Returns a Description of the AlarmModel in the default Locale.
* This normally returns a full Description of the AlarmModel in the
- * default Locale.
+ * default Locale.
*/
public String getDescription()
{
@@ -98,7 +96,7 @@
{
return ALARM_TYPES;
}
-
+
public String computeTrigger( AlarmState state, boolean condition )
{
if( condition )
@@ -119,10 +117,10 @@
}
return null;
}
-
+
public boolean computeCondition( AlarmState state )
{
- return (state instanceof ActivatedState) ||
+ return (state instanceof ActivatedState) ||
(state instanceof AcknowledgedState);
}

@@ -137,7 +135,7 @@
AlarmState newState = new ActivatedState();
long time = System.currentTimeMillis();
return new ActivationEvent( source, alarm, oldState, newState,
time );
- }
+ }
return null;
}

@@ -152,11 +150,11 @@
AlarmState newState = new NormalState();
return new DeactivationEvent( source, alarm, oldState, newState,
time );
}
- else if ( oldState instanceof ActivatedState )
+ else if ( oldState instanceof ActivatedState )
{
AlarmState newState = new DeactivatedState();
return new DeactivationEvent( source, alarm, oldState, newState,
time );
- }
+ }
return null;
}

@@ -171,11 +169,11 @@
AlarmState newState = new NormalState();
return new AcknowledgeEvent( source, alarm, oldState, newState,
time );
}
- else if( oldState instanceof ActivatedState )
+ else if( oldState instanceof ActivatedState )
{
AlarmState newState = new AcknowledgedState();
return new AcknowledgeEvent( source, alarm, oldState, newState,
time );
- }
+ }
return null;
}
}

Modified:
development/laboratory/planet/industry/industrial-automation/services/alarm/src/main/net/dpml/ia/alarm/AlarmService.java
==============================================================================
---
development/laboratory/planet/industry/industrial-automation/services/alarm/src/main/net/dpml/ia/alarm/AlarmService.java
(original)
+++
development/laboratory/planet/industry/industrial-automation/services/alarm/src/main/net/dpml/ia/alarm/AlarmService.java
Mon Jan 10 18:32:24 2005
@@ -18,7 +18,6 @@

package net.dpml.ia.alarm;

-import java.util.Map;
import java.util.Collection;

/** Defines the AlarmService interface.
@@ -26,7 +25,7 @@
* <p>
* The <code>AlarmService</code> is a central registry/handler for all
* <code>Alarm</code> objects. By registering <code>AlarmListener</code>s
- * to the AlarmService, objects are able to 'ignore' the fact that there
+ * to the AlarmService, objects are able to 'ignore' the fact that there
* are many <code>Alarm</code> objects in the system.
* </p>
* <p>
@@ -51,11 +50,11 @@
/** Returns all the AlarmModels that has been installed.
**/
AlarmModel[] getAlarmModels();
-
+
/** Returns the default AlarmModel.
**/
AlarmModel getDefaultAlarmModel();
-
+
/** Sets the default AlarmModel.
* Changes the default AlarmModel. All Alarms belonging
* to the old default AlarmModel will be re-assigned to the
@@ -66,10 +65,10 @@
**/
void setDefaultAlarmModel( AlarmModel model );

-
+
/** Returns a list of all Alarms registered to the service.
* <p>
- * The returned Collection may not be modified in any way. The
+ * The returned Collection may not be modified in any way. The
* implementation is free to return a clone, but not required to do
* so, and may decide to terminate if the collection is modified.
* </p>
@@ -77,10 +76,10 @@
Collection getAlarms();

/** Creates an Alarm with the default AlarmModel.
- **/
- Alarm createAlarm( String name )
+ **/
+ Alarm createAlarm( String name )
throws AlarmCreationException;
-
+
/** Register AlarmListener to recieve <code>AlarmEvents</code> from all
* <code>Alarms</code> managed by this <code>AlarmService</code>.
*/
@@ -93,7 +92,7 @@
/** Returns a list of all AlarmListeners registered to the service.
*/
Collection getAlarmListeners();
-
+
/** Adds an AlarmModel to this service.
*/
void addAlarmModel( AlarmModel model );



  • svn commit: r1444 - in development/laboratory/planet/industry/industrial-automation: parts/alarm/src/main/net/dpml/ia/parts/alarm services/alarm/src/main/net/dpml/ia/alarm, niclas, 01/10/2005

Archive powered by MHonArc 2.6.24.

Top of Page