

	public void stirUpTrouble( String theAction )
	{
		try
		{
          // Get the Scheduler
          //
		    System.out.println("MyAgent is stirring up trouble MyAgent ********* ");          
          	InitialContext initialContext = new InitialContext();
          	
            Object schedulerObj = initialContext.lookup("scheduler/AgentScheduler");    
            System.out.println("Got the Scheduler Object from the name space");          
            Scheduler scheduler = (Scheduler)javax.rmi.PortableRemoteObject.narrow(schedulerObj,Scheduler.class);
            System.out.println("Got the AgentScheduler Object ");
            
          // Get the handler which will be called when the task runs
          //
            Object doSomethingHomeObj = initialContext.lookup("ejb/jks/DoSomething");
            System.out.println("Got the DoSomething Home from the Name space"); 
     	    TaskHandlerHome doSomethingHome = (TaskHandlerHome) PortableRemoteObject.narrow(doSomethingHomeObj,TaskHandlerHome.class);     
     	    System.out.println("Got the DoSomething Object ");  
     	                
          // Create our Schedule Task Info for our Report Generator Home EJB
          //
            TaskInfo taskInfo = new BeanTaskInfo(doSomethingHome);
            System.out.println("TaskInfo created");
            taskInfo.setStartTimeInterval("15");
            taskInfo.setRepeatInterval("30");
            taskInfo.setNumberOfRepeats(5);
            try
			{
				taskInfo.setUserCalendar("ejb/jks/MyUserCalendar", "seconds");
			}
			catch (UserCalendarInvalid e)
			{
				throw new EJBException(e);
			}
			try
			{
				scheduler.create(taskInfo);
				System.out.println("*****************  Task Scheduled ************");
			}
			catch (UserCalendarSpecifierInvalid e)
			{
				throw new EJBException(e);
			}
			catch (UserCalendarInvalid e)
			{
				throw new EJBException(e);
			}
			catch (UserCalendarPeriodInvalid e)
			{
				throw new EJBException(e);
			}
			catch (TaskInvalid e)
			{
				throw new EJBException(e);
			}
			catch (SchedulerNotAvailableException e)
			{
				throw new EJBException(e);
			}
			catch (NotificationSinkInvalid e)
			{
				throw new EJBException(e);
			}
			catch (NotificationException e)
			{
				throw new EJBException(e);
			}   
				
          System.out.println("TaskInfo scheduled #2");   
		}
        catch (javax.naming.NamingException ne) 
        {
            throw new EJBException(ne);
        } 
        catch (RemoteException re) 
        {
            throw new EJBException(re);
        }
          		
		return;	
	}