Using a CommonJ implementation with GlassFish and Spring 3

前端 未结 3 1218
情话喂你
情话喂你 2021-02-10 04:45

In my quest to unify deployment among Websphere 7 and GlassFish 3 environments, I decided to try implementing a CommonJ WorkManager and TimerManager in GlassFish. But it isn\'t

3条回答
  •  渐次进展
    2021-02-10 05:06

    I don't think it's a good idea to use the TimerManager of myFoo CommonJ - in addition to being dormant for about 6 years, the code is just strange at some points (referring to v1.1). E.g. the isExpired method of the FooTimer class looks like this:

    public boolean isExpired() {
        return scheduledExcecutionTime >= System.currentTimeMillis();
    }
    

    So, the timer will expire when its scheduled next execution time is in the future? Nonsense - that should be the other way round!

    Somewhere else (TimerExecutor#run), notifyAll is called on an object (TimerManager) that the current thread has no monitor for, constantly causing java.lang.IllegalMonitorStateExceptions.

    Hands off!

提交回复
热议问题