Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

BasicTaskQosketImpl.java

Go to the documentation of this file.
00001 /*
00002  * BasicTaskQosketImpl.java
00003  *
00004  * Copyright (c) 2003 The University of Utah and the Flux Group.
00005  * All rights reserved.
00006  *
00007  * This file is licensed under the terms of the GNU Public License.  
00008  * See the file "license.terms" for restrictions on redistribution 
00009  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  */
00011 
00012 /**
00013  * @file BasicTaskQosketImpl.java
00014  *
00015  * Default implementation of a Qosket::Basic::BasicTaskQosket.
00016  */
00017 
00018 package Qosket.Basic;
00019 
00020 import com.bbn.quo.corba.QuoKernel;
00021 import com.bbn.quo.corba.ValueSC;
00022 import com.bbn.quo.corba.Callback;
00023 import com.bbn.quo.corba.ValueSCHelper;
00024 import com.bbn.quo.corba.impl.Connector;
00025 
00026 import rk.ResourceSet;
00027 
00028 /**
00029  * A subclass of the Qosket::Basic::BasicTaskQosketSkel class generated from
00030  * the BasicTaskContract.  The implementation is pretty straightforward, it
00031  * gets its system conditions from the quo::QuoKernel and creates the callback
00032  * itself.
00033  *
00034  * @sa BasicTaskQosketImpl
00035  * @sa Qosket::Basic::BasicTaskCallback
00036  * @sa BasicTaskCallbackImpl
00037  * @sa StubBasicTaskCallback
00038  * @sa BasicTaskContract.cdl
00039  */
00040 public class BasicTaskQosketImpl
00041     extends BasicTaskQosketSkel
00042 {
00043     public void initSysconds(QuoKernel kernel)
00044     {
00045         org.omg.CORBA.Object raw =
00046             Connector.instantiateSysCond(kernel,
00047                                          "DeadlinesMissed",
00048                                          "quo::ValueSC",
00049                                          "quo_sc::ValueSCImpl");
00050         this.myDeadlinesMissed = ValueSCHelper.narrow(raw);
00051 
00052         raw = Connector.instantiateSysCond(kernel,
00053                                            "LastStatus",
00054                                            "quo::ValueSC",
00055                                            "quo_sc::ValueSCImpl");
00056         this.myLastStatus = ValueSCHelper.narrow(raw);
00057     }
00058 
00059     public void initCallbacks()
00060     {
00061         BasicTaskCallbackImpl btci;
00062 
00063         btci = new BasicTaskCallbackImpl("BasicTaskCallback");
00064         try
00065         {
00066             (com.bbn.quo.corba.impl.Connector.quoPOA()).
00067                 activate_object(btci);
00068         }
00069         catch(Exception e)
00070         {
00071             e.printStackTrace();
00072         }
00073         this.myCallback = btci._this();
00074     }
00075 
00076     public ValueSC DeadlinesMissed()
00077     {
00078         return this.myDeadlinesMissed;
00079     }
00080 
00081     public void DeadlinesMissed(ValueSC vs)
00082     {
00083     }
00084     
00085     public ValueSC LastStatus()
00086     {
00087         return this.myLastStatus;
00088     }
00089 
00090     public void LastStatus(ValueSC vs)
00091     {
00092     }
00093     
00094     public Callback Callback()
00095     {
00096         return this.myCallback;
00097     }
00098 
00099     public void Callback(Callback cb)
00100     {
00101     }
00102     
00103     public synchronized long RUsage()
00104     {
00105         long retval = rk.ResourceSet.getUsage();
00106         
00107         return retval;
00108     }
00109 
00110     public void RUsage(long l)
00111     {
00112     }
00113     
00114     public String toString()
00115     {
00116         return "BasicTaskQosketImpl["
00117             + super.toString()
00118             + "]";
00119     }
00120 }

Generated on Mon Dec 1 16:29:06 2003 for CPU Broker by doxygen 1.3.4