WebLogic Timer services.

WebLogic has deprecated Timer services with version 6.1 and recommend using Flux.
What is the rationale behind that? What do other scheduling services offer over the
standard JDK java.util.Timer class where I can kick of scheduled tasks?
Thanks ahead of time for your response.
Regards,
Amit

.... but if done from startup, a timer is not in an app and thus can't see
the app's environment?
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"Rob Woollen" <[email protected]> wrote in message
news:[email protected]..
Yes, that should work fine. What is the error?
-- Rob
Satish Yellanki wrote:
Hi,
I am trying to use the weblogic timer services.
I implemented the TriggerDef interface and deployed
the trigger using "Scheduler" and "Trigger" classes.
(Server-side triggers.)
However, when the trigger is run, will I be able to
do a InitialContext() without any parameters and use
it to do JNDI lookup? I am running into an error doing
that and am not sure if I am doing the right thing.
Thanks,
Satish--
Coming Soon: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnweblogic.com

Similar Messages

  • Best practice using Using the WebLogic Timer Service

    Hi,
    We have a stateless session bean having a method which needs to be called lezs
    say every 10 Seconds. I think the WebLogic Timer Service (JMX) should exactly
    fit in this problem. So I would write a small class implementing the interface
    NotificationListener which will receive the notification. The listener I would
    register in my startup class.
    This brings up some questions:
    Could this class be a inner class of the SessionBean and directly calling the
    method on the bean ?
    Has it to be a more independent class gettting an initiali context, getting local
    home, etc. etc. and then executing the method on the received Stub ? If yes can
    it keep the Stub betwean the interval without releasing ?
    Has someone experiance in this area ?
    Regards
    Tomy

    Actually, it's bad practice to use break anywhere other than in conjunction with a switch statement.Presumably, if you favour:
    boolean test = true;
    while (test)
      test = foo && bar;
      if (test)
    }overfor (;;)
      if (! ( foo && bar) ) break;
    }then you also favour
    boolean test = foo && bar;
    if (test)
    }overif (foo && bar)
    }Or can you justify your statement with any example which doesn't cause more complexity, more variables in scope, and multiple assignments and tests?

  • Monitoring Weblogic Time Service

    Hello
    I built a number of java classes that implemented ScheduleDef and
    Triggerdef.
    Then these classes are scheduled using WebLogic Time Service.
    The question is :
    Is there a way to query WLS to find out how many of these classes are
    currently
    being scheduled? We need to find out which one are no longer running in the
    system
    so we can reschedule them. But we also need to know if one is already
    scheduled and
    therefore disallow the ability to schedule a 2nd instance in the server.
    Thanks

    They did state a reason. They expect these services to become part of J2EE.
    You can still use them, or check out something like Flux from Sims
    Computing.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "James McGovern" <[email protected]> wrote in message
    news:[email protected]..
    BEA has deprecated the time services classes without stating any reason.
    Hopefully they will step up and come up with a replacement.

  • WebLogic Time Service

    Hi,
    I've created a time service on the server, which gets activated on
    startup and repeatly occurs at some given interval. However, I need to
    stop the timer and restart it again when the time interval is changed.
    Is it possible to do that without bringing down the server?
    Thanks,
    TomyD

    Mario -
    I believe the way it works is you call the schedule () method of your WL
    Time Services implementing object first. For example:
    // Obtain a T3Services factory
    T3ServicesDef t3 = getT3Services ();
    // Request a ScheduledTrigger from the factory. Use
    // this class for scheduling and execution
    std = t3.time().getScheduledTrigger(this, this);
    // Start the ball rolling
    std.schedule();
    Your schedule method would specify the point of time in the future in
    which you are interested.
    Your trigger method, when invoked, should set some instance variable in
    your class. Your schedule method will be invoked after your trigger
    method completes. When your schedule method is invoked, it should check
    the instance variable and if it has been set, the schedule method should
    return 0 to prevent the trigger from being called again.
    Make sure that the schedule method is correctly setting the returned
    long.
    Oh --- your class should be implementing the Schedulable and Triggerable
    interfaces, in case you were using something else. I agree that the
    documentation for this feature seems pretty confusing.
    Peter
    "Mario B. Jones" wrote:
    >
    List,
    As you can tell, I've been spending alot of time playing with Weblogic
    time service lately, and needless to say, I've been running into alot of
    roadblocks.
    Question.
    How in the heck do you implement the time api to perform a "one-time"
    trigger for some point of time in the future? All of the examples, api
    documentation, etc talks you through the necessary to perform
    "recurring" actions. But nothing on one time actions. I have tried
    several different variations but cannot get it done. Seems like the
    trigger will immediately fire the first time but can be delayed for
    future iterations till a specified point of time in the future using
    java.util.Date methods.
    Help!
    Thanks in advance...

  • Persisting a trigger with weblogic time services

    Hello,
    I'm using Weblogic v4.51
    Does weblogic provide a way to persist triggerable events so that if the
    server is shut down and restarted, the triggerable events are still
    scheduled?
    Or do I have to write my own persistence system for scheduled events?
    any comments are appreciated,
    thanks,
    Tom

    Yes, you are in true.
    But, I can't understand it. Weblogic allow to execute a number of threads that
    couldn't go far in execution (they haven't resources) ... and maintains them runnable.
    But, the thread that could progress in their execution (they have the resources)
    aren't runnables ...
    The only solution is the one you say ... but I think the way weblogic schedules
    the execute threads isn't a good way.
    Thanks
    "Adam Messinger" <[email protected]> wrote:
    >
    "jlglez" <[email protected]> wrote in message
    news:3b9899a4$[email protected]..
    Ok. I have a problem with concurrency and locks with weblogic ... hereis
    my thread
    dump:
    Number of Threads of my Server: 15
    Number of Threads of my Application: 25
    LDAPPool: 5
    Yes, I know the second is bigger than the first. I try to create anscenario of
    a number of apps over the same server.It looks like the majority of your threads are waiting while attempting
    to
    get an LDAP connection. Make that pool bigger (same size as number of
    execute threads).
    Cheers!
    Adam

  • Weblogic singleto with weblogic timer

    Pls give some sample for using both weblogic singleton and weblogic timer.

    weblogic sibgleton should invoke weblogic timer service?

  • WL Time Service Questions

    Hello -
    A few questions about Weblogic Time Services:
    1. What is BEA's policy on supporting this functionality for future
    Weblogic releases?
    2. Will BEA be supporting the JMX javax.management.timer functionality
    as a replacement in future releases?
    3. What happens if an EJB schedules a trigger and the application
    containing the EJB is not deployed at the time of the trigger (or has
    been redeployed in between)?
    4. Any suggestions for persistence of scheduled triggers between
    application deployments?
    Can anyone suggest a J2EE-compliant alternative to these services?
    Thanks
    Peter

    Peter Mularien wrote:
    1. What is BEA's policy on supporting this functionality for future
    Weblogic releases?I believe it will be deprecated in the next major release (although it
    will remain around for at least 2 releases after deprecation).Do you all have anything planned yet to replace it?There is an internal proposal for "TimerDrivenBeans". I wish JavaSoft would
    just define an appropriate J2EE API for this, and be done with it.
    >
    >
    2. Will BEA be supporting the JMX javax.management.timer functionality
    as a replacement in future releases?This is a possibility. In fact, it probably works today. There is
    also the java.util.Timer API. I'm not too keen on it, as it spawns a
    thread, rather than having an ability to use a thread pool.I note that JBoss is one app server which does support the
    javax.management.timer functionality. But they seem to have embraced JMX
    even more fully than Weblogic did in 6.x.Yes, I noticed that too.
    >
    >
    >>>
    3. What happens if an EJB schedules a trigger and the application
    containing the EJB is not deployed at the time of the trigger (or
    has been redeployed in between)?If the bean is not present, I suppose the timer will receive an
    exception (and if it's not caught, I believe the timer will be
    cancelled). If it's redeployed, it should just work, but I'm not 100%
    sure.I suppose I'll try it out and report back here.
    4. Any suggestions for persistence of scheduled triggers between
    application deployments?You'd have to have your own persistence mechanism... we don't have a
    solution for this. Except for using JMS messages with birth times.I noticed that JMS birth times was a new feature in 6.1. That is a
    Weblogic-specific feature, though, and not covered in the JMS spec,
    correct?Yes, WebLogic specific.
    It wouldn't be terribly difficult for us to wrap the WL Time Service
    functionality with a persistence layer, either.I think that would be a really nice feature.
    >
    Can anyone suggest a J2EE-compliant alternative to these services?Our JMS service has an ability to have a cron-like message which can
    drive a MessageDrivenBean, or, I believe, a message that has a "birth
    time" which will cause the message to be delivered at a particular time
    in the future.I'll explore that option as well. Thanks for your detailed responses.
    Peter

  • Does WebLogic Server 8.1 supports ejb2.1(timer service)

    1.does WebLogic Server 8.1(SP5) supports ejb2.1 (timer service)?
    2. does ejb 2.0 support timer service?

    Hi,
    1. No, EJB Timer support was added in WLS 9.0.
    2. No, EJB Timers were introduced in EJB 2.1.
    - Matt

  • Deprecation of time services

    Hi all,
    in WebLogic 6.1 time services are deprecated
    (http://e-docs.bea.com/wls/docs61/notes/issues.html#1031137). Own
    threads are not allowed by the specification. How can I correctly
    schedule items in WebLogic 6.1? Ideas?
    Thanks,
    Daniel

    I don't know what BEA's opinion is on the use of the standard JMX
    timer service (javax.management.timer) in WLS 6.1, but these
    interfaces are very nice to use, and they appear to function
    well.
    Perhaps one of the BEA folks might want to comment on this approach.
    Ben
    On Mon, 30 Jul 2001 13:08:26 -0700, Michael Girdley <----> wrote:
    You can still use 6.1 Time. It's only for client side. This will be fixed
    in the final docs.
    MG
    Michael Girdley
    BEA Systems
    Learning WebLogic? http://learnweblogic.com
    "Daniel Hoppe" <[email protected]> wrote in message
    news:[email protected]..
    Hi all,
    in WebLogic 6.1 time services are deprecated
    (http://e-docs.bea.com/wls/docs61/notes/issues.html#1031137). Own
    threads are not allowed by the specification. How can I correctly
    schedule items in WebLogic 6.1? Ideas?
    Thanks,
    Daniel

  • Time service load-balancing

    Hi,
    I have a question about load-balancing facilities for Time service. If I
    schedule a TimeScheduleDef object to run at certain intervals, does the
    run-time environment take care of load balancing it across multiple machines
    on a cluster?
    Thanks,
    Deepak

    WebLogic Time is not a clustered service -- it is configured per server and
    load balancing is performed.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    Deepak Goel <[email protected]> wrote in message
    news:8gvrdb$n18$[email protected]..
    Hi,
    I have a question about load-balancing facilities for Time service. If I
    schedule a TimeScheduleDef object to run at certain intervals, does the
    run-time environment take care of load balancing it across multiplemachines
    on a cluster?
    Thanks,
    Deepak

  • Weblogic.security.service.NotAuthorizedRuntimeException

    We see the following exception occur at random. We are trying to access a CMP ejb
    that connects to an Oracle db. It works fine at times.
    Any help would be appreciated.
    Thanks.
    weblogic.security.service.NotAuthorizedRuntimeException: [Security:090419]Subjec
    t "<null>" is not the kernel identity
    at weblogic.security.service.SubjectManagerImpl.checkKernelIdentity(Subj
    ectManagerImpl.java:215)
    at weblogic.security.subject.DelegatingSubjectStack.getCurrentSubject(De
    legatingSubjectStack.java:31)
    at weblogic.security.service.SubjectManagerImpl.getCurrentSubject(Subjec
    tManagerImpl.java:61)
    at weblogic.security.service.SecurityManager.getCurrentSubject(SecurityM
    anager.java:43)
    at weblogic.rjvm.JVMID.getClusterURL(JVMID.java:1204)
    at weblogic.rjvm.JVMID.getClusterURL(JVMID.java:1192)
    at weblogic.rjvm.RJVMImpl.getClusterURL(RJVMImpl.java:596)
    at weblogic.rmi.cluster.ClusterActivatableRemoteRef.readExternal(Cluster
    ActivatableRemoteRef.java:124)
    at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:168
    6)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
    644)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:18
    45)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:45
    2)
    at weblogic.rmi.internal.StubInfo.readObject(StubInfo.java:116)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
    646)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
    bjectInputStream.java:119)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
    va:112)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:285)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:244)
    at com.sun.j2ee.blueprints.customer.ejb.CustomerEJB_tzvy3k_HomeImpl_811_
    WLStub.findByPrimaryKey(Unknown Source)
    at com.kinzan.library.ecm.login.LoginAction.handleEvent(Unknown Source)

    Balaji Rajasekaran <> writes:
    i couln't find that in weblogic.jar ( WLS 10 )In 10 it will probably be in the css implementation. I'm not sure what
    the name of the jar is.
    andy

  • Time Service usage within WL.

    Hi:
    I would like to use Time service to schedule async execution on my
    classes. However, all the examples show how to use it from a client. I
    would like to use it from within a servlet. I would also like to avoid
    any unnecessary overhead in calling t3 client utilities.
    So the questing is this: is there a nice way to directly get a handle to
    the time service from within a servlet?
    I would appreciate any help in this matter.
    -- Paul

    Paul Iter wrote:
    >
    Hi:
    I would like to use Time service to schedule async execution on my
    classes. However, all the examples show how to use it from a client. I
    would like to use it from within a servlet. I would also like to avoid
    any unnecessary overhead in calling t3 client utilities.
    So the questing is this: is there a nice way to directly get a handle to
    the time service from within a servlet?Yes. Call the static method:
         T3ServicesDef services = weblogic.common.T3Services.getT3Services();
         ScheduledTriggerDef std = services.time().getScheduledTrigger(....);

  • Help for weblogic timer

    Please help on timer.
    Thanks a lot.
    Xiao
    I got the following error when try to use weblogic timer:
    <NT Performance Pack> NATIVE: created IoCompletionPort successfully.
    IoPort=0x00
    00024c
    Tue Aug 08 12:24:55 PDT 2000:<I> <WebLogicServer> WebLogic Server
    started
    Tue Aug 08 12:25:09 PDT 2000:<I> <ListenThread> Adding address:
    localhost/127.0.
    0.1 to licensed client list
    Tue Aug 08 12:25:09 PDT 2000:<I> <NT Performance Pack> Allocating: '2'
    NT reader
    threads
    Tue Aug 08 12:25:14 PDT 2000:<I> <CliCon-#|myserver|0.965762672267>
    Connection t
    o client for ClientContext - id: '#|myserver|0.965762672267', bound:
    'true', dea
    d: 'false' has been unexpectedly lost because
    weblogic.rjvm.PeerGoneException:
    - with nested exception:
    [java.net.SocketException: Connection reset by peer].
    Initiating hard disconnect.
    Tue Aug 08 12:25:14 PDT 2000:<I> <CliCon-#|myserver|0.965762672267>
    Removing Cli
    entContext - id: '#|myserver|0.965762672267', bound: 'false', dead:
    'false' beca
    use of hard disconnect timeout
    the code for the timer
    * CONFIDENTIAL, Copyright (C) 2000
    * This file is copyrighted by Uhere and should not be reproduced
    * in any form and/or distributed without prior consent of Uhere.
    package com.uhere.ubs.service;
    * Timer for auction
    * @author Xiao Zhou
    * @version 1.0
    * @since 1.0
    import weblogic.time.common.*;
    import weblogic.common.*;
    import weblogic.jndi.*;
    import javax.naming.*;
    import java.util.*;
    import com.uhere.ubs.utility.*;
    public class AuctionTimer implements ScheduleDef, TriggerDef {
    private T3ServicesDef services;
    private final int AUCTION_SETUPED = 0;
    private final int AUCTION_STARTED = 1;
    private final int AUCTION_CLOSING = 2;
    private long startTime = 0, endTime = 0, timeIncrement = 0;
    private int auctionItemId = 0, status = 0;
    public void setServices(T3ServicesDef services) {
    this.services = services;
    * ScheduleDef Interface
    * @param ParamSet
    * @exception ParamSetException
    * @since 1.0
    public void scheduleInit(ParamSet ps) throws ParamSetException {
    startTime = ps.getParam("startTime").asLong();
    endTime = ps.getParam("endTime").asLong();
    timeIncrement = ps.getParam("timeIncrement").asLong();
    auctionItemId = ps.getParam("auctionItemId").asInt();
    * TriggerDef interface
    * @param ParamSet
    * @exception ParamSetException
    * @since 1.0
    public void triggerInit(ParamSet ps) throws ParamSetException {
    * This method is only called internally by Weblogic schedule when
    the action will be called next time
    * @param long time
    * @return time for next triggger
    * @since 1.0
    public long schedule(long t) {
    System.out.println("signal schedule1");
    if (status == AUCTION_SETUPED) {
    System.out.println("signal schedule2");
    return startTime;
    else if (timeIncrement == 0 || t < endTime - timeIncrement) {
    status = AUCTION_CLOSING;
    return endTime;
    else
    return t + timeIncrement;
    * This method is only called internally by Weblogic scheduled
    action
    * @param Schedulable
    * @since 1.0
    public void trigger(Schedulable sched) {
    System.out.println("signal schedule3");
    if (status == AUCTION_SETUPED) {
    status = AUCTION_STARTED;
    System.out.println("start auction");
    else if (status == AUCTION_CLOSING) {
    System.out.println("close auction");
    else {
    System.out.println("signal auction");
    * external parties call this method to start the scheduled cycle of
    action.
    * @exception UBSException
    * @since 1.0
    * @param startTime
    * @param endTime
    * @param timeIncrement
    * @param auctionItemId
    public static void startTimer(long startTime, long endTime, long
    timeIncrement, int auctionItemId,
    String url) throws UBSException {
    try {
    System.out.println("signal startTime1");
    ParamSet schedParams = new ParamSet();
    schedParams.setParam("startTime", startTime);
    schedParams.setParam("endTime", endTime);
    schedParams.setParam("timeIncrement", timeIncrement);
    schedParams.setParam("auctionItemId", auctionItemId);
    Scheduler scheduler = new
    Scheduler("com.uhere.ubs.service.CommonTimer", schedParams);
    Trigger trigger = new
    Trigger("com.uhere.ubs.service.CommonTimer");
    ScheduledTriggerDef std =
    getT3Services(url).time().getScheduledTrigger(scheduler, trigger);
    std.schedule();
    System.out.println("signal startTime2");
    } catch (Exception e) {
    UBSException.handle(e, UBSException.OP_EXP);
    private static T3ServicesDef getT3Services(String wlUrl) throws
    javax.naming.NamingException {
    T3ServicesDef t3s;
    Hashtable env = new Hashtable();
    env.put(Context.PROVIDER_URL, wlUrl);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    weblogic.jndi.WLInitialContextFactory.class.getName());
    Context ctx = new InitialContext(env);
    t3s = (T3ServicesDef)ctx.lookup("weblogic.common.T3Services");
    ctx.close();
    return (t3s);
    client
    static public void testTimer() {
    try {
    long time = new Date().getTime();
    AuctionTimer.startTimer(time+5000,time+20000,0,0,url);
    catch (Throwable t) { t.printStackTrace(); }

    I've used a std timer in Java
    Try the following :
    private Timer timer; // The thread
    public void startTimer(){
    timer = new Timer();
    timer.schedule(closeConnection,1000*60,1000*120);
    then run startTimer whenever you wanna hit it...
    regards,
    Dag Norland,
    Donar AS, Norway
    "Xiao Zhou" <[email protected]> wrote in message
    news:[email protected]...
    Please help on timer.
    Thanks a lot.
    Xiao
    I got the following error when try to use weblogic timer:
    <NT Performance Pack> NATIVE: created IoCompletionPort successfully.
    IoPort=0x00
    00024c
    Tue Aug 08 12:24:55 PDT 2000:<I> <WebLogicServer> WebLogic Server
    started
    Tue Aug 08 12:25:09 PDT 2000:<I> <ListenThread> Adding address:
    localhost/127.0.
    0.1 to licensed client list
    Tue Aug 08 12:25:09 PDT 2000:<I> <NT Performance Pack> Allocating: '2'
    NT reader
    threads
    Tue Aug 08 12:25:14 PDT 2000:<I> <CliCon-#|myserver|0.965762672267>
    Connection t
    o client for ClientContext - id: '#|myserver|0.965762672267', bound:
    'true', dea
    d: 'false' has been unexpectedly lost because
    weblogic.rjvm.PeerGoneException:
    - with nested exception:
    [java.net.SocketException: Connection reset by peer].
    Initiating hard disconnect.
    Tue Aug 08 12:25:14 PDT 2000:<I> <CliCon-#|myserver|0.965762672267>
    Removing Cli
    entContext - id: '#|myserver|0.965762672267', bound: 'false', dead:
    'false' beca
    use of hard disconnect timeout
    the code for the timer
    >
    * CONFIDENTIAL, Copyright (C) 2000
    * This file is copyrighted by Uhere and should not be reproduced
    * in any form and/or distributed without prior consent of Uhere.
    >
    >
    >
    >
    package com.uhere.ubs.service;
    * Timer for auction
    * @author Xiao Zhou
    * @version 1.0
    * @since 1.0
    import weblogic.time.common.*;
    import weblogic.common.*;
    import weblogic.jndi.*;
    import javax.naming.*;
    import java.util.*;
    import com.uhere.ubs.utility.*;
    public class AuctionTimer implements ScheduleDef, TriggerDef {
    private T3ServicesDef services;
    private final int AUCTION_SETUPED = 0;
    private final int AUCTION_STARTED = 1;
    private final int AUCTION_CLOSING = 2;
    private long startTime = 0, endTime = 0, timeIncrement = 0;
    private int auctionItemId = 0, status = 0;
    public void setServices(T3ServicesDef services) {
    this.services = services;
    * ScheduleDef Interface
    * @param ParamSet
    * @exception ParamSetException
    * @since 1.0
    public void scheduleInit(ParamSet ps) throws ParamSetException {
    startTime = ps.getParam("startTime").asLong();
    endTime = ps.getParam("endTime").asLong();
    timeIncrement = ps.getParam("timeIncrement").asLong();
    auctionItemId = ps.getParam("auctionItemId").asInt();
    * TriggerDef interface
    * @param ParamSet
    * @exception ParamSetException
    * @since 1.0
    public void triggerInit(ParamSet ps) throws ParamSetException {
    * This method is only called internally by Weblogic schedule when
    the action will be called next time
    * @param long time
    * @return time for next triggger
    * @since 1.0
    public long schedule(long t) {
    System.out.println("signal schedule1");
    if (status == AUCTION_SETUPED) {
    System.out.println("signal schedule2");
    return startTime;
    else if (timeIncrement == 0 || t < endTime - timeIncrement) {
    status = AUCTION_CLOSING;
    return endTime;
    else
    return t + timeIncrement;
    * This method is only called internally by Weblogic scheduled
    action
    * @param Schedulable
    * @since 1.0
    public void trigger(Schedulable sched) {
    System.out.println("signal schedule3");
    if (status == AUCTION_SETUPED) {
    status = AUCTION_STARTED;
    System.out.println("start auction");
    else if (status == AUCTION_CLOSING) {
    System.out.println("close auction");
    else {
    System.out.println("signal auction");
    * external parties call this method to start the scheduled cycle of
    action.
    * @exception UBSException
    * @since 1.0
    * @param startTime
    * @param endTime
    * @param timeIncrement
    * @param auctionItemId
    public static void startTimer(long startTime, long endTime, long
    timeIncrement, int auctionItemId,
    String url) throws UBSException {
    try {
    System.out.println("signal startTime1");
    ParamSet schedParams = new ParamSet();
    schedParams.setParam("startTime", startTime);
    schedParams.setParam("endTime", endTime);
    schedParams.setParam("timeIncrement", timeIncrement);
    schedParams.setParam("auctionItemId", auctionItemId);
    Scheduler scheduler = new
    Scheduler("com.uhere.ubs.service.CommonTimer", schedParams);
    Trigger trigger = new
    Trigger("com.uhere.ubs.service.CommonTimer");
    ScheduledTriggerDef std =
    getT3Services(url).time().getScheduledTrigger(scheduler, trigger);
    std.schedule();
    System.out.println("signal startTime2");
    } catch (Exception e) {
    UBSException.handle(e, UBSException.OP_EXP);
    private static T3ServicesDef getT3Services(String wlUrl) throws
    javax.naming.NamingException {
    T3ServicesDef t3s;
    Hashtable env = new Hashtable();
    env.put(Context.PROVIDER_URL, wlUrl);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    weblogic.jndi.WLInitialContextFactory.class.getName());
    Context ctx = new InitialContext(env);
    t3s = (T3ServicesDef)ctx.lookup("weblogic.common.T3Services");
    ctx.close();
    return (t3s);
    client
    static public void testTimer() {
    try {
    long time = new Date().getTime();
    AuctionTimer.startTimer(time+5000,time+20000,0,0,url);
    catch (Throwable t) { t.printStackTrace(); }

  • Clustered Time Services

    Hi,
              I've got several time / schedule related services that are registered upon
              server startup. We are moving from a single server instance to a several
              clustered instances. As expected, I've run into an issue where each
              scheduled service on each cluster is firing independently of the others and
              thus I'm getting multiple notifications of each scheduled event.
              My question is this... how do most shops handle this type of situation? We
              want to have a scalable / failable? solution. I know I can take care of the
              problem by only registering the scheduled objects in a single per server
              properties file, but I lose any type of failover.
              I'm thinking of starting the scheduled services on each server in the
              cluster and binding a next run time into the JNDI tree. When a scheduled
              event fires it would check the next run time to see if it can run its
              schedule. If not it would reschedule itself to check later and effectively
              go back to sleep. If it can run it would do so and increment the next run
              time and reschedule itself to check later and go back to sleep.
              Any thoughts???
              Thanks in advance,
              Steve...
              

    See: http://e-docs.bea.com/wls/docs61/programming.html
              Nalika wrote:
              > Hi,
              >
              > In BEA online docs (
              > http://e-docs.bea.com/wls/docs61/cluster/overview.html ) it describes about
              > Non-Clustered Services and APIs as
              >
              > File services
              > Time services
              > WebLogic Events (deprecated in WebLogic Server 6.0)
              > Workspaces (deprecated in WebLogic Server 6.0)
              > ZAC
              > etc...
              >
              > Can anyone have an idea of what these services means ?
              > Please respond.
              >
              > Thanks
              > Nalika
              

  • The EJB 2.1 Timer Service & Clustering Behavior

    With respect to WebLogic Server 9.0, does anyone know if The EJB 2.1 Timer Service will automatically restart a timer in the event of an entire cluster failure? Thanks,
              -Matt

    Tim Farrell <> writes:
              > Good question. Since theres little to no documentation on the new EJB Timer or the TimerService implemented in 9.0 I would also like to know this.
              >
              > In fact, drilling down further, I want to understand what happens in a cluster when one of the servers fails with Timers scheduled.
              >
              > 1. Do they migrate to other servers ?
              No
              > 2. How do they migrate ?
              > 3. Will they migrate back to the original server when it comes back up ?
              > 4. When will the docs get completed for this feature ?
              Its possible that if you mark the server as migratable and have your
              store using HA then migration would work, although I'm certain that
              this has been tested.
              andy

Maybe you are looking for