Revision: 16306
Author: brainslog
Date: Mon Jan 10 01:37:58 2011
Log: Fixing Diameter Findbugs job (removing @Override)
http://code.google.com/p/mobicents/source/detail?r=16306
Modified:
/trunk/servers/diameter/core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/timer/LocalTimerFacilityImpl.java
=======================================
---
/trunk/servers/diameter/core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/timer/LocalTimerFacilityImpl.java
Wed Jan 5 05:59:05 2011
+++
/trunk/servers/diameter/core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/timer/LocalTimerFacilityImpl.java
Mon Jan 10 01:37:58 2011
@@ -26,9 +26,6 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
@@ -54,16 +51,11 @@
private ScheduledExecutorService executor;
- @SuppressWarnings("unchecked")
-// private ConcurrentHashMap<String, ScheduledFuture> idToFutureMapping;
-
private ISessionDatasource sessionDataSource;
- @SuppressWarnings("unchecked")
public LocalTimerFacilityImpl(IContainer container) {
super();
this.executor =
container.getConcurrentFactory().getScheduledExecutorService(IConcurrentFactory.ScheduledExecServices.ApplicationSession.name());
-// this.idToFutureMapping = new ConcurrentHashMap<String,
ScheduledFuture>();
this.sessionDataSource =
container.getAssemblerFacility().getComponentInstance(ISessionDatasource.class);
}
@@ -72,44 +64,35 @@
*
* @see
org.jdiameter.common.api.timer.ITimerFacility#cancel(java.io.Serializable)
*/
- @SuppressWarnings("unchecked")
public void cancel(Serializable f) {
-
- if( f!= null && f instanceof TimerTaskHandle)
- {
- TimerTaskHandle timerTaskHandle = (TimerTaskHandle)f;
- timerTaskHandle.future.cancel(false);
- }
-
-
+ if(f!= null && f instanceof TimerTaskHandle) {
+ TimerTaskHandle timerTaskHandle = (TimerTaskHandle)f;
+ timerTaskHandle.future.cancel(false);
+ }
}
/*
* (non-Javadoc)
- *
* @see
org.jdiameter.common.api.timer.ITimerFacility#schedule(java.lang.String,
java.lang.String, long)
*/
- @SuppressWarnings("unchecked")
public Serializable schedule(String sessionId, String timerName, long
milliseconds) throws IllegalArgumentException {
String id = sessionId + "/" + timerName;
logger.debug("Scheduling timer with id {}", id);
TimerTaskHandle ir = new TimerTaskHandle();
- ir.id = id;
ir.sessionId = sessionId;
ir.timerName = timerName;
ir.future = this.executor.schedule(ir, milliseconds,
TimeUnit.MILLISECONDS);
- return ir;
-
+
+ return ir;
}
private final class TimerTaskHandle implements Runnable, Externalizable {
- //its not realy serializable;
+ // its not really serializable;
private String sessionId;
private String timerName;
- private String id;
private transient ScheduledFuture<?> future;
- public void run() {
-
+
+ public void run() {
try {
BaseSession bSession = sessionDataSource.getSession(sessionId);
if (bSession == null || !bSession.isAppSession()) {
@@ -117,37 +100,36 @@
return;
}
else {
- try{
- AppSessionImpl impl = (AppSessionImpl) bSession;
- impl.onTimer(timerName);
- }catch(Exception e)
- {
- logger.error("Caught exception from app session
object!",e);
- }
+ try{
+ AppSessionImpl impl = (AppSessionImpl) bSession;
+ impl.onTimer(timerName);
+ }
+ catch(Exception e) {
+ logger.error("Caught exception from app session object!",e);
+ }
}
}
catch (Exception e) {
logger.error("Failure executing timer task", e);
}
}
- /* (non-Javadoc)
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- @Override
- public void writeExternal(ObjectOutput out) throws IOException {
- throw new IOException("Failed to serialize local timer!");
-
- }
- /* (non-Javadoc)
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- @Override
- public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
- throw new IOException("Failed to deserialize local timer!");
-
- }
-
-
+
+ /*
+ * (non-Javadoc)
+ * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
+ */
+ public void writeExternal(ObjectOutput out) throws IOException {
+ throw new IOException("Failed to serialize local timer!");
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
+ */
+ public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
+ throw new IOException("Failed to deserialize local timer!");
+ }
}
}