Source Code Cross Referenced for RemoteScheduler.java in  » Project-Management » quartz » org » quartz » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Project Management » quartz » org.quartz.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /* 
0002:         * Copyright 2004-2005 OpenSymphony 
0003:         * 
0004:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
0005:         * use this file except in compliance with the License. You may obtain a copy 
0006:         * of the License at 
0007:         * 
0008:         *   http://www.apache.org/licenses/LICENSE-2.0 
0009:         *   
0010:         * Unless required by applicable law or agreed to in writing, software 
0011:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
0012:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
0013:         * License for the specific language governing permissions and limitations 
0014:         * under the License.
0015:         * 
0016:         */
0017:
0018:        /*
0019:         * Previously Copyright (c) 2001-2004 James House
0020:         */
0021:        package org.quartz.impl;
0022:
0023:        import java.rmi.RemoteException;
0024:        import java.rmi.registry.LocateRegistry;
0025:        import java.rmi.registry.Registry;
0026:        import java.util.Date;
0027:        import java.util.List;
0028:        import java.util.Set;
0029:
0030:        import org.quartz.Calendar;
0031:        import org.quartz.JobDataMap;
0032:        import org.quartz.JobDetail;
0033:        import org.quartz.JobListener;
0034:        import org.quartz.Scheduler;
0035:        import org.quartz.SchedulerContext;
0036:        import org.quartz.SchedulerException;
0037:        import org.quartz.SchedulerListener;
0038:        import org.quartz.SchedulerMetaData;
0039:        import org.quartz.Trigger;
0040:        import org.quartz.TriggerListener;
0041:        import org.quartz.UnableToInterruptJobException;
0042:        import org.quartz.core.RemotableQuartzScheduler;
0043:        import org.quartz.core.SchedulingContext;
0044:        import org.quartz.spi.JobFactory;
0045:
0046:        /**
0047:         * <p>
0048:         * An implementation of the <code>Scheduler</code> interface that remotely
0049:         * proxies all method calls to the equivalent call on a given <code>QuartzScheduler</code>
0050:         * instance, via RMI.
0051:         * </p>
0052:         * 
0053:         * @see org.quartz.Scheduler
0054:         * @see org.quartz.core.QuartzScheduler
0055:         * @see org.quartz.core.SchedulingContext
0056:         * 
0057:         * @author James House
0058:         */
0059:        public class RemoteScheduler implements  Scheduler {
0060:
0061:            /*
0062:             * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0063:             * 
0064:             * Data members.
0065:             * 
0066:             * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0067:             */
0068:
0069:            private RemotableQuartzScheduler rsched;
0070:
0071:            private SchedulingContext schedCtxt;
0072:
0073:            private String schedId;
0074:
0075:            private String rmiHost;
0076:
0077:            private int rmiPort;
0078:
0079:            /*
0080:             * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0081:             * 
0082:             * Constructors.
0083:             * 
0084:             * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0085:             */
0086:
0087:            /**
0088:             * <p>
0089:             * Construct a <code>RemoteScheduler</code> instance to proxy the given
0090:             * <code>RemoteableQuartzScheduler</code> instance, and with the given
0091:             * <code>SchedulingContext</code>.
0092:             * </p>
0093:             */
0094:            public RemoteScheduler(SchedulingContext schedCtxt, String schedId,
0095:                    String host, int port) {
0096:
0097:                this .schedCtxt = schedCtxt;
0098:                this .schedId = schedId;
0099:                this .rmiHost = host;
0100:                this .rmiPort = port;
0101:            }
0102:
0103:            /*
0104:             * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0105:             * 
0106:             * Interface.
0107:             * 
0108:             * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0109:             */
0110:
0111:            protected RemotableQuartzScheduler getRemoteScheduler()
0112:                    throws SchedulerException {
0113:                if (rsched != null) {
0114:                    return rsched;
0115:                }
0116:
0117:                try {
0118:                    Registry registry = LocateRegistry.getRegistry(rmiHost,
0119:                            rmiPort);
0120:
0121:                    rsched = (RemotableQuartzScheduler) registry
0122:                            .lookup(schedId);
0123:
0124:                } catch (Exception e) {
0125:                    SchedulerException initException = new SchedulerException(
0126:                            "Could not get handle to remote scheduler: "
0127:                                    + e.getMessage(), e);
0128:                    initException
0129:                            .setErrorCode(SchedulerException.ERR_COMMUNICATION_FAILURE);
0130:                    throw initException;
0131:                }
0132:
0133:                return rsched;
0134:            }
0135:
0136:            protected SchedulerException invalidateHandleCreateException(
0137:                    String msg, Exception cause) {
0138:                rsched = null;
0139:                SchedulerException ex = new SchedulerException(msg, cause);
0140:                ex.setErrorCode(SchedulerException.ERR_COMMUNICATION_FAILURE);
0141:                return ex;
0142:            }
0143:
0144:            /**
0145:             * <p>
0146:             * Returns the name of the <code>Scheduler</code>.
0147:             * </p>
0148:             */
0149:            public String getSchedulerName() throws SchedulerException {
0150:                try {
0151:                    return getRemoteScheduler().getSchedulerName();
0152:                } catch (RemoteException re) {
0153:                    throw invalidateHandleCreateException(
0154:                            "Error communicating with remote scheduler.", re);
0155:                }
0156:            }
0157:
0158:            /**
0159:             * <p>
0160:             * Returns the instance Id of the <code>Scheduler</code>.
0161:             * </p>
0162:             */
0163:            public String getSchedulerInstanceId() throws SchedulerException {
0164:                try {
0165:                    return getRemoteScheduler().getSchedulerInstanceId();
0166:                } catch (RemoteException re) {
0167:                    throw invalidateHandleCreateException(
0168:                            "Error communicating with remote scheduler.", re);
0169:                }
0170:            }
0171:
0172:            public SchedulerMetaData getMetaData() throws SchedulerException {
0173:                try {
0174:                    RemotableQuartzScheduler sched = getRemoteScheduler();
0175:                    return new SchedulerMetaData(getSchedulerName(),
0176:                            getSchedulerInstanceId(), getClass(), true,
0177:                            isStarted(), isInStandbyMode(), isShutdown(), sched
0178:                                    .runningSince(), sched.numJobsExecuted(),
0179:                            sched.getJobStoreClass(), sched
0180:                                    .supportsPersistence(), sched
0181:                                    .getThreadPoolClass(), sched
0182:                                    .getThreadPoolSize(), sched.getVersion());
0183:
0184:                } catch (RemoteException re) {
0185:                    throw invalidateHandleCreateException(
0186:                            "Error communicating with remote scheduler.", re);
0187:                }
0188:
0189:            }
0190:
0191:            /**
0192:             * <p>
0193:             * Returns the <code>SchedulerContext</code> of the <code>Scheduler</code>.
0194:             * </p>
0195:             */
0196:            public SchedulerContext getContext() throws SchedulerException {
0197:                try {
0198:                    return getRemoteScheduler().getSchedulerContext();
0199:                } catch (RemoteException re) {
0200:                    throw invalidateHandleCreateException(
0201:                            "Error communicating with remote scheduler.", re);
0202:                }
0203:            }
0204:
0205:            ///////////////////////////////////////////////////////////////////////////
0206:            ///
0207:            /// Schedululer State Management Methods
0208:            ///
0209:            ///////////////////////////////////////////////////////////////////////////
0210:
0211:            /**
0212:             * <p>
0213:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0214:             * </p>
0215:             */
0216:            public void start() throws SchedulerException {
0217:                try {
0218:                    getRemoteScheduler().start();
0219:                } catch (RemoteException re) {
0220:                    throw invalidateHandleCreateException(
0221:                            "Error communicating with remote scheduler.", re);
0222:                }
0223:            }
0224:
0225:            /**
0226:             * <p>
0227:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0228:             * </p>
0229:             */
0230:            public void standby() throws SchedulerException {
0231:                try {
0232:                    getRemoteScheduler().standby();
0233:                } catch (RemoteException re) {
0234:                    throw invalidateHandleCreateException(
0235:                            "Error communicating with remote scheduler.", re);
0236:                }
0237:            }
0238:
0239:            /**
0240:             * @see org.quartz.Scheduler#pause()
0241:             * @deprecated
0242:             */
0243:            public void pause() throws SchedulerException {
0244:                this .standby();
0245:            }
0246:
0247:            /**
0248:             * Whether the scheduler has been started.  
0249:             * 
0250:             * <p>
0251:             * Note: This only reflects whether <code>{@link #start()}</code> has ever
0252:             * been called on this Scheduler, so it will return <code>true</code> even 
0253:             * if the <code>Scheduler</code> is currently in standby mode or has been 
0254:             * since shutdown.
0255:             * </p>
0256:             * 
0257:             * @see #start()
0258:             * @see #isShutdown()
0259:             * @see #isInStandbyMode()
0260:             */
0261:            public boolean isStarted() throws SchedulerException {
0262:                try {
0263:                    return (getRemoteScheduler().runningSince() != null);
0264:                } catch (RemoteException re) {
0265:                    throw invalidateHandleCreateException(
0266:                            "Error communicating with remote scheduler.", re);
0267:                }
0268:            }
0269:
0270:            /**
0271:             * <p>
0272:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0273:             * </p>
0274:             */
0275:            public boolean isInStandbyMode() throws SchedulerException {
0276:                try {
0277:                    return getRemoteScheduler().isInStandbyMode();
0278:                } catch (RemoteException re) {
0279:                    throw invalidateHandleCreateException(
0280:                            "Error communicating with remote scheduler.", re);
0281:                }
0282:            }
0283:
0284:            public boolean isPaused() throws SchedulerException {
0285:                return this .isInStandbyMode();
0286:            }
0287:
0288:            /**
0289:             * <p>
0290:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0291:             * </p>
0292:             */
0293:            public void shutdown() throws SchedulerException {
0294:                try {
0295:                    String schedulerName = getSchedulerName();
0296:
0297:                    getRemoteScheduler().shutdown();
0298:
0299:                    SchedulerRepository.getInstance().remove(schedulerName);
0300:                } catch (RemoteException re) {
0301:                    throw invalidateHandleCreateException(
0302:                            "Error communicating with remote scheduler.", re);
0303:                }
0304:            }
0305:
0306:            /**
0307:             * <p>
0308:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0309:             * </p>
0310:             */
0311:            public void shutdown(boolean waitForJobsToComplete)
0312:                    throws SchedulerException {
0313:                try {
0314:                    String schedulerName = getSchedulerName();
0315:
0316:                    getRemoteScheduler().shutdown(waitForJobsToComplete);
0317:
0318:                    SchedulerRepository.getInstance().remove(schedulerName);
0319:                } catch (RemoteException re) {
0320:                    throw invalidateHandleCreateException(
0321:                            "Error communicating with remote scheduler.", re);
0322:                }
0323:            }
0324:
0325:            /**
0326:             * <p>
0327:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0328:             * </p>
0329:             */
0330:            public boolean isShutdown() throws SchedulerException {
0331:                try {
0332:                    return getRemoteScheduler().isShutdown();
0333:                } catch (RemoteException re) {
0334:                    throw invalidateHandleCreateException(
0335:                            "Error communicating with remote scheduler.", re);
0336:                }
0337:            }
0338:
0339:            /**
0340:             * <p>
0341:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0342:             * </p>
0343:             */
0344:            public List getCurrentlyExecutingJobs() throws SchedulerException {
0345:                try {
0346:                    return getRemoteScheduler().getCurrentlyExecutingJobs();
0347:                } catch (RemoteException re) {
0348:                    throw invalidateHandleCreateException(
0349:                            "Error communicating with remote scheduler.", re);
0350:                }
0351:            }
0352:
0353:            ///////////////////////////////////////////////////////////////////////////
0354:            ///
0355:            /// Scheduling-related Methods
0356:            ///
0357:            ///////////////////////////////////////////////////////////////////////////
0358:
0359:            /**
0360:             * <p>
0361:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0362:             * passing the <code>SchedulingContext</code> associated with this
0363:             * instance.
0364:             * </p>
0365:             */
0366:            public Date scheduleJob(JobDetail jobDetail, Trigger trigger)
0367:                    throws SchedulerException {
0368:                try {
0369:                    return getRemoteScheduler().scheduleJob(schedCtxt,
0370:                            jobDetail, trigger);
0371:                } catch (RemoteException re) {
0372:                    throw invalidateHandleCreateException(
0373:                            "Error communicating with remote scheduler.", re);
0374:                }
0375:            }
0376:
0377:            /**
0378:             * <p>
0379:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0380:             * passing the <code>SchedulingContext</code> associated with this
0381:             * instance.
0382:             * </p>
0383:             */
0384:            public Date scheduleJob(Trigger trigger) throws SchedulerException {
0385:                try {
0386:                    return getRemoteScheduler().scheduleJob(schedCtxt, trigger);
0387:                } catch (RemoteException re) {
0388:                    throw invalidateHandleCreateException(
0389:                            "Error communicating with remote scheduler.", re);
0390:                }
0391:            }
0392:
0393:            /**
0394:             * <p>
0395:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0396:             * passing the <code>SchedulingContext</code> associated with this
0397:             * instance.
0398:             * </p>
0399:             */
0400:            public void addJob(JobDetail jobDetail, boolean replace)
0401:                    throws SchedulerException {
0402:                try {
0403:                    getRemoteScheduler().addJob(schedCtxt, jobDetail, replace);
0404:                } catch (RemoteException re) {
0405:                    throw invalidateHandleCreateException(
0406:                            "Error communicating with remote scheduler.", re);
0407:                }
0408:            }
0409:
0410:            /**
0411:             * <p>
0412:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0413:             * passing the <code>SchedulingContext</code> associated with this
0414:             * instance.
0415:             * </p>
0416:             */
0417:            public boolean deleteJob(String jobName, String groupName)
0418:                    throws SchedulerException {
0419:                try {
0420:                    return getRemoteScheduler().deleteJob(schedCtxt, jobName,
0421:                            groupName);
0422:                } catch (RemoteException re) {
0423:                    throw invalidateHandleCreateException(
0424:                            "Error communicating with remote scheduler.", re);
0425:                }
0426:            }
0427:
0428:            /**
0429:             * <p>
0430:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0431:             * passing the <code>SchedulingContext</code> associated with this
0432:             * instance.
0433:             * </p>
0434:             */
0435:            public boolean unscheduleJob(String triggerName, String groupName)
0436:                    throws SchedulerException {
0437:                try {
0438:                    return getRemoteScheduler().unscheduleJob(schedCtxt,
0439:                            triggerName, groupName);
0440:                } catch (RemoteException re) {
0441:                    throw invalidateHandleCreateException(
0442:                            "Error communicating with remote scheduler.", re);
0443:                }
0444:            }
0445:
0446:            /**
0447:             * <p>
0448:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0449:             * passing the <code>SchedulingContext</code> associated with this
0450:             * instance.
0451:             * </p>
0452:             */
0453:            public Date rescheduleJob(String triggerName, String groupName,
0454:                    Trigger newTrigger) throws SchedulerException {
0455:                try {
0456:                    return getRemoteScheduler().rescheduleJob(schedCtxt,
0457:                            triggerName, groupName, newTrigger);
0458:                } catch (RemoteException re) {
0459:                    throw invalidateHandleCreateException(
0460:                            "Error communicating with remote scheduler.", re);
0461:                }
0462:            }
0463:
0464:            /**
0465:             * <p>
0466:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0467:             * passing the <code>SchedulingContext</code> associated with this
0468:             * instance.
0469:             * </p>
0470:             */
0471:            public void triggerJob(String jobName, String groupName)
0472:                    throws SchedulerException {
0473:                triggerJob(jobName, groupName, null);
0474:            }
0475:
0476:            /**
0477:             * <p>
0478:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0479:             * passing the <code>SchedulingContext</code> associated with this
0480:             * instance.
0481:             * </p>
0482:             */
0483:            public void triggerJob(String jobName, String groupName,
0484:                    JobDataMap data) throws SchedulerException {
0485:                try {
0486:                    getRemoteScheduler().triggerJob(schedCtxt, jobName,
0487:                            groupName, data);
0488:                } catch (RemoteException re) {
0489:                    throw invalidateHandleCreateException(
0490:                            "Error communicating with remote scheduler.", re);
0491:                }
0492:            }
0493:
0494:            /**
0495:             * <p>
0496:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0497:             * passing the <code>SchedulingContext</code> associated with this
0498:             * instance.
0499:             * </p>
0500:             */
0501:            public void triggerJobWithVolatileTrigger(String jobName,
0502:                    String groupName) throws SchedulerException {
0503:                triggerJobWithVolatileTrigger(jobName, groupName, null);
0504:            }
0505:
0506:            /**
0507:             * <p>
0508:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0509:             * passing the <code>SchedulingContext</code> associated with this
0510:             * instance.
0511:             * </p>
0512:             */
0513:            public void triggerJobWithVolatileTrigger(String jobName,
0514:                    String groupName, JobDataMap data)
0515:                    throws SchedulerException {
0516:                try {
0517:                    getRemoteScheduler().triggerJobWithVolatileTrigger(
0518:                            schedCtxt, jobName, groupName, data);
0519:                } catch (RemoteException re) {
0520:                    throw invalidateHandleCreateException(
0521:                            "Error communicating with remote scheduler.", re);
0522:                }
0523:            }
0524:
0525:            /**
0526:             * <p>
0527:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0528:             * passing the <code>SchedulingContext</code> associated with this
0529:             * instance.
0530:             * </p>
0531:             */
0532:            public void pauseTrigger(String triggerName, String groupName)
0533:                    throws SchedulerException {
0534:                try {
0535:                    getRemoteScheduler().pauseTrigger(schedCtxt, triggerName,
0536:                            groupName);
0537:                } catch (RemoteException re) {
0538:                    throw invalidateHandleCreateException(
0539:                            "Error communicating with remote scheduler.", re);
0540:                }
0541:            }
0542:
0543:            /**
0544:             * <p>
0545:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0546:             * passing the <code>SchedulingContext</code> associated with this
0547:             * instance.
0548:             * </p>
0549:             */
0550:            public void pauseTriggerGroup(String groupName)
0551:                    throws SchedulerException {
0552:                try {
0553:                    getRemoteScheduler()
0554:                            .pauseTriggerGroup(schedCtxt, groupName);
0555:                } catch (RemoteException re) {
0556:                    throw invalidateHandleCreateException(
0557:                            "Error communicating with remote scheduler.", re);
0558:                }
0559:            }
0560:
0561:            /**
0562:             * <p>
0563:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0564:             * passing the <code>SchedulingContext</code> associated with this
0565:             * instance.
0566:             * </p>
0567:             */
0568:            public void pauseJob(String jobName, String groupName)
0569:                    throws SchedulerException {
0570:                try {
0571:                    getRemoteScheduler()
0572:                            .pauseJob(schedCtxt, jobName, groupName);
0573:                } catch (RemoteException re) {
0574:                    throw invalidateHandleCreateException(
0575:                            "Error communicating with remote scheduler.", re);
0576:                }
0577:            }
0578:
0579:            /**
0580:             * <p>
0581:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0582:             * passing the <code>SchedulingContext</code> associated with this
0583:             * instance.
0584:             * </p>
0585:             */
0586:            public void pauseJobGroup(String groupName)
0587:                    throws SchedulerException {
0588:                try {
0589:                    getRemoteScheduler().pauseJobGroup(schedCtxt, groupName);
0590:                } catch (RemoteException re) {
0591:                    throw invalidateHandleCreateException(
0592:                            "Error communicating with remote scheduler.", re);
0593:                }
0594:            }
0595:
0596:            /**
0597:             * <p>
0598:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0599:             * passing the <code>SchedulingContext</code> associated with this
0600:             * instance.
0601:             * </p>
0602:             */
0603:            public void resumeTrigger(String triggerName, String groupName)
0604:                    throws SchedulerException {
0605:                try {
0606:                    getRemoteScheduler().resumeTrigger(schedCtxt, triggerName,
0607:                            groupName);
0608:                } catch (RemoteException re) {
0609:                    throw invalidateHandleCreateException(
0610:                            "Error communicating with remote scheduler.", re);
0611:                }
0612:            }
0613:
0614:            /**
0615:             * <p>
0616:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0617:             * passing the <code>SchedulingContext</code> associated with this
0618:             * instance.
0619:             * </p>
0620:             */
0621:            public void resumeTriggerGroup(String groupName)
0622:                    throws SchedulerException {
0623:                try {
0624:                    getRemoteScheduler().resumeTriggerGroup(schedCtxt,
0625:                            groupName);
0626:                } catch (RemoteException re) {
0627:                    throw invalidateHandleCreateException(
0628:                            "Error communicating with remote scheduler.", re);
0629:                }
0630:            }
0631:
0632:            /**
0633:             * <p>
0634:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0635:             * passing the <code>SchedulingContext</code> associated with this
0636:             * instance.
0637:             * </p>
0638:             */
0639:            public void resumeJob(String jobName, String groupName)
0640:                    throws SchedulerException {
0641:                try {
0642:                    getRemoteScheduler().resumeJob(schedCtxt, jobName,
0643:                            groupName);
0644:                } catch (RemoteException re) {
0645:                    throw invalidateHandleCreateException(
0646:                            "Error communicating with remote scheduler.", re);
0647:                }
0648:            }
0649:
0650:            /**
0651:             * <p>
0652:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0653:             * passing the <code>SchedulingContext</code> associated with this
0654:             * instance.
0655:             * </p>
0656:             */
0657:            public void resumeJobGroup(String groupName)
0658:                    throws SchedulerException {
0659:                try {
0660:                    getRemoteScheduler().resumeJobGroup(schedCtxt, groupName);
0661:                } catch (RemoteException re) {
0662:                    throw invalidateHandleCreateException(
0663:                            "Error communicating with remote scheduler.", re);
0664:                }
0665:            }
0666:
0667:            /**
0668:             * <p>
0669:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0670:             * passing the <code>SchedulingContext</code> associated with this
0671:             * instance.
0672:             * </p>
0673:             */
0674:            public void pauseAll() throws SchedulerException {
0675:                try {
0676:                    getRemoteScheduler().pauseAll(schedCtxt);
0677:                } catch (RemoteException re) {
0678:                    throw invalidateHandleCreateException(
0679:                            "Error communicating with remote scheduler.", re);
0680:                }
0681:            }
0682:
0683:            /**
0684:             * <p>
0685:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0686:             * passing the <code>SchedulingContext</code> associated with this
0687:             * instance.
0688:             * </p>
0689:             */
0690:            public void resumeAll() throws SchedulerException {
0691:                try {
0692:                    getRemoteScheduler().resumeAll(schedCtxt);
0693:                } catch (RemoteException re) {
0694:                    throw invalidateHandleCreateException(
0695:                            "Error communicating with remote scheduler.", re);
0696:                }
0697:            }
0698:
0699:            /**
0700:             * <p>
0701:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0702:             * passing the <code>SchedulingContext</code> associated with this
0703:             * instance.
0704:             * </p>
0705:             */
0706:            public String[] getJobGroupNames() throws SchedulerException {
0707:                try {
0708:                    return getRemoteScheduler().getJobGroupNames(schedCtxt);
0709:                } catch (RemoteException re) {
0710:                    throw invalidateHandleCreateException(
0711:                            "Error communicating with remote scheduler.", re);
0712:                }
0713:            }
0714:
0715:            /**
0716:             * <p>
0717:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0718:             * passing the <code>SchedulingContext</code> associated with this
0719:             * instance.
0720:             * </p>
0721:             */
0722:            public String[] getJobNames(String groupName)
0723:                    throws SchedulerException {
0724:                try {
0725:                    return getRemoteScheduler().getJobNames(schedCtxt,
0726:                            groupName);
0727:                } catch (RemoteException re) {
0728:                    throw invalidateHandleCreateException(
0729:                            "Error communicating with remote scheduler.", re);
0730:                }
0731:            }
0732:
0733:            /**
0734:             * <p>
0735:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0736:             * passing the <code>SchedulingContext</code> associated with this
0737:             * instance.
0738:             * </p>
0739:             */
0740:            public Trigger[] getTriggersOfJob(String jobName, String groupName)
0741:                    throws SchedulerException {
0742:                try {
0743:                    return getRemoteScheduler().getTriggersOfJob(schedCtxt,
0744:                            jobName, groupName);
0745:                } catch (RemoteException re) {
0746:                    throw invalidateHandleCreateException(
0747:                            "Error communicating with remote scheduler.", re);
0748:                }
0749:            }
0750:
0751:            /**
0752:             * <p>
0753:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0754:             * passing the <code>SchedulingContext</code> associated with this
0755:             * instance.
0756:             * </p>
0757:             */
0758:            public String[] getTriggerGroupNames() throws SchedulerException {
0759:                try {
0760:                    return getRemoteScheduler().getTriggerGroupNames(schedCtxt);
0761:                } catch (RemoteException re) {
0762:                    throw invalidateHandleCreateException(
0763:                            "Error communicating with remote scheduler.", re);
0764:                }
0765:            }
0766:
0767:            /**
0768:             * <p>
0769:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0770:             * passing the <code>SchedulingContext</code> associated with this
0771:             * instance.
0772:             * </p>
0773:             */
0774:            public String[] getTriggerNames(String groupName)
0775:                    throws SchedulerException {
0776:                try {
0777:                    return getRemoteScheduler().getTriggerNames(schedCtxt,
0778:                            groupName);
0779:                } catch (RemoteException re) {
0780:                    throw invalidateHandleCreateException(
0781:                            "Error communicating with remote scheduler.", re);
0782:                }
0783:            }
0784:
0785:            /**
0786:             * <p>
0787:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0788:             * passing the <code>SchedulingContext</code> associated with this
0789:             * instance.
0790:             * </p>
0791:             */
0792:            public JobDetail getJobDetail(String jobName, String jobGroup)
0793:                    throws SchedulerException {
0794:                try {
0795:                    return getRemoteScheduler().getJobDetail(schedCtxt,
0796:                            jobName, jobGroup);
0797:                } catch (RemoteException re) {
0798:                    throw invalidateHandleCreateException(
0799:                            "Error communicating with remote scheduler.", re);
0800:                }
0801:            }
0802:
0803:            /**
0804:             * <p>
0805:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0806:             * passing the <code>SchedulingContext</code> associated with this
0807:             * instance.
0808:             * </p>
0809:             */
0810:            public Trigger getTrigger(String triggerName, String triggerGroup)
0811:                    throws SchedulerException {
0812:                try {
0813:                    return getRemoteScheduler().getTrigger(schedCtxt,
0814:                            triggerName, triggerGroup);
0815:                } catch (RemoteException re) {
0816:                    throw invalidateHandleCreateException(
0817:                            "Error communicating with remote scheduler.", re);
0818:                }
0819:            }
0820:
0821:            /**
0822:             * <p>
0823:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0824:             * passing the <code>SchedulingContext</code> associated with this
0825:             * instance.
0826:             * </p>
0827:             */
0828:            public int getTriggerState(String triggerName, String triggerGroup)
0829:                    throws SchedulerException {
0830:                try {
0831:                    return getRemoteScheduler().getTriggerState(schedCtxt,
0832:                            triggerName, triggerGroup);
0833:                } catch (RemoteException re) {
0834:                    throw invalidateHandleCreateException(
0835:                            "Error communicating with remote scheduler.", re);
0836:                }
0837:            }
0838:
0839:            /**
0840:             * <p>
0841:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0842:             * passing the <code>SchedulingContext</code> associated with this
0843:             * instance.
0844:             * </p>
0845:             */
0846:            public void addCalendar(String calName, Calendar calendar,
0847:                    boolean replace, boolean updateTriggers)
0848:                    throws SchedulerException {
0849:                try {
0850:                    getRemoteScheduler().addCalendar(schedCtxt, calName,
0851:                            calendar, replace, updateTriggers);
0852:                } catch (RemoteException re) {
0853:                    throw invalidateHandleCreateException(
0854:                            "Error communicating with remote scheduler.", re);
0855:                }
0856:            }
0857:
0858:            /**
0859:             * <p>
0860:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0861:             * passing the <code>SchedulingContext</code> associated with this
0862:             * instance.
0863:             * </p>
0864:             */
0865:            public boolean deleteCalendar(String calName)
0866:                    throws SchedulerException {
0867:                try {
0868:                    return getRemoteScheduler().deleteCalendar(schedCtxt,
0869:                            calName);
0870:                } catch (RemoteException re) {
0871:                    throw invalidateHandleCreateException(
0872:                            "Error communicating with remote scheduler.", re);
0873:                }
0874:            }
0875:
0876:            /**
0877:             * <p>
0878:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0879:             * passing the <code>SchedulingContext</code> associated with this
0880:             * instance.
0881:             * </p>
0882:             */
0883:            public Calendar getCalendar(String calName)
0884:                    throws SchedulerException {
0885:                try {
0886:                    return getRemoteScheduler().getCalendar(schedCtxt, calName);
0887:                } catch (RemoteException re) {
0888:                    throw invalidateHandleCreateException(
0889:                            "Error communicating with remote scheduler.", re);
0890:                }
0891:            }
0892:
0893:            /**
0894:             * <p>
0895:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
0896:             * passing the <code>SchedulingContext</code> associated with this
0897:             * instance.
0898:             * </p>
0899:             */
0900:            public String[] getCalendarNames() throws SchedulerException {
0901:                try {
0902:                    return getRemoteScheduler().getCalendarNames(schedCtxt);
0903:                } catch (RemoteException re) {
0904:                    throw invalidateHandleCreateException(
0905:                            "Error communicating with remote scheduler.", re);
0906:                }
0907:            }
0908:
0909:            ///////////////////////////////////////////////////////////////////////////
0910:            ///
0911:            /// Listener-related Methods
0912:            ///
0913:            ///////////////////////////////////////////////////////////////////////////
0914:
0915:            /**
0916:             * <p>
0917:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0918:             * </p>
0919:             */
0920:            public void addGlobalJobListener(JobListener jobListener)
0921:                    throws SchedulerException {
0922:                throw new SchedulerException(
0923:                        "Operation not supported for remote schedulers.",
0924:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
0925:            }
0926:
0927:            /**
0928:             * <p>
0929:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0930:             * </p>
0931:             */
0932:            public void addJobListener(JobListener jobListener)
0933:                    throws SchedulerException {
0934:                throw new SchedulerException(
0935:                        "Operation not supported for remote schedulers.",
0936:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
0937:            }
0938:
0939:            /**
0940:             * <p>
0941:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0942:             * </p>
0943:             * @deprecated Use <code>{@link #removeGlobalJobListener(String)}</code>
0944:             */
0945:            public boolean removeGlobalJobListener(JobListener jobListener)
0946:                    throws SchedulerException {
0947:                throw new SchedulerException(
0948:                        "Operation not supported for remote schedulers.",
0949:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
0950:            }
0951:
0952:            /**
0953:             * <p>
0954:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0955:             * </p>
0956:             */
0957:            public boolean removeGlobalJobListener(String name)
0958:                    throws SchedulerException {
0959:                throw new SchedulerException(
0960:                        "Operation not supported for remote schedulers.",
0961:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
0962:            }
0963:
0964:            /**
0965:             * <p>
0966:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0967:             * </p>
0968:             */
0969:            public boolean removeJobListener(String name)
0970:                    throws SchedulerException {
0971:                throw new SchedulerException(
0972:                        "Operation not supported for remote schedulers.",
0973:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
0974:            }
0975:
0976:            /**
0977:             * <p>
0978:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0979:             * </p>
0980:             */
0981:            public List getGlobalJobListeners() throws SchedulerException {
0982:                throw new SchedulerException(
0983:                        "Operation not supported for remote schedulers.",
0984:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
0985:            }
0986:
0987:            /**
0988:             * <p>
0989:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
0990:             * </p>
0991:             */
0992:            public Set getJobListenerNames() throws SchedulerException {
0993:                throw new SchedulerException(
0994:                        "Operation not supported for remote schedulers.",
0995:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
0996:            }
0997:
0998:            /**
0999:             * <p>
1000:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1001:             * </p>
1002:             */
1003:            public JobListener getGlobalJobListener(String name)
1004:                    throws SchedulerException {
1005:                throw new SchedulerException(
1006:                        "Operation not supported for remote schedulers.",
1007:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1008:            }
1009:
1010:            /**
1011:             * <p>
1012:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1013:             * </p>
1014:             */
1015:            public JobListener getJobListener(String name)
1016:                    throws SchedulerException {
1017:                throw new SchedulerException(
1018:                        "Operation not supported for remote schedulers.",
1019:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1020:            }
1021:
1022:            /**
1023:             * <p>
1024:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1025:             * </p>
1026:             */
1027:            public void addGlobalTriggerListener(TriggerListener triggerListener)
1028:                    throws SchedulerException {
1029:                throw new SchedulerException(
1030:                        "Operation not supported for remote schedulers.",
1031:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1032:            }
1033:
1034:            /**
1035:             * <p>
1036:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1037:             * </p>
1038:             */
1039:            public void addTriggerListener(TriggerListener triggerListener)
1040:                    throws SchedulerException {
1041:                throw new SchedulerException(
1042:                        "Operation not supported for remote schedulers.",
1043:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1044:            }
1045:
1046:            /**
1047:             * <p>
1048:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1049:             * </p>
1050:             * @deprecated Use <code>{@link #removeGlobalTriggerListener(String)}</code>
1051:             */
1052:            public boolean removeGlobalTriggerListener(
1053:                    TriggerListener triggerListener) throws SchedulerException {
1054:                throw new SchedulerException(
1055:                        "Operation not supported for remote schedulers.",
1056:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1057:            }
1058:
1059:            /**
1060:             * <p>
1061:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1062:             * </p>
1063:             */
1064:            public boolean removeGlobalTriggerListener(String name)
1065:                    throws SchedulerException {
1066:                throw new SchedulerException(
1067:                        "Operation not supported for remote schedulers.",
1068:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1069:            }
1070:
1071:            /**
1072:             * <p>
1073:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1074:             * </p>
1075:             */
1076:            public boolean removeTriggerListener(String name)
1077:                    throws SchedulerException {
1078:                throw new SchedulerException(
1079:                        "Operation not supported for remote schedulers.",
1080:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1081:            }
1082:
1083:            /**
1084:             * <p>
1085:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1086:             * </p>
1087:             */
1088:            public List getGlobalTriggerListeners() throws SchedulerException {
1089:                throw new SchedulerException(
1090:                        "Operation not supported for remote schedulers.",
1091:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1092:            }
1093:
1094:            /**
1095:             * <p>
1096:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1097:             * </p>
1098:             */
1099:            public Set getTriggerListenerNames() throws SchedulerException {
1100:                throw new SchedulerException(
1101:                        "Operation not supported for remote schedulers.",
1102:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1103:            }
1104:
1105:            /**
1106:             * <p>
1107:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1108:             * </p>
1109:             */
1110:            public TriggerListener getGlobalTriggerListener(String name)
1111:                    throws SchedulerException {
1112:                throw new SchedulerException(
1113:                        "Operation not supported for remote schedulers.",
1114:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1115:            }
1116:
1117:            /**
1118:             * <p>
1119:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1120:             * </p>
1121:             */
1122:            public TriggerListener getTriggerListener(String name)
1123:                    throws SchedulerException {
1124:                throw new SchedulerException(
1125:                        "Operation not supported for remote schedulers.",
1126:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1127:            }
1128:
1129:            /**
1130:             * <p>
1131:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1132:             * </p>
1133:             */
1134:            public void addSchedulerListener(SchedulerListener schedulerListener)
1135:                    throws SchedulerException {
1136:                throw new SchedulerException(
1137:                        "Operation not supported for remote schedulers.",
1138:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1139:            }
1140:
1141:            /**
1142:             * <p>
1143:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1144:             * </p>
1145:             */
1146:            public boolean removeSchedulerListener(
1147:                    SchedulerListener schedulerListener)
1148:                    throws SchedulerException {
1149:                throw new SchedulerException(
1150:                        "Operation not supported for remote schedulers.",
1151:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1152:            }
1153:
1154:            /**
1155:             * <p>
1156:             * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
1157:             * </p>
1158:             */
1159:            public List getSchedulerListeners() throws SchedulerException {
1160:                throw new SchedulerException(
1161:                        "Operation not supported for remote schedulers.",
1162:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1163:            }
1164:
1165:            /** 
1166:             * @see org.quartz.Scheduler#getPausedTriggerGroups()
1167:             */
1168:            public Set getPausedTriggerGroups() throws SchedulerException {
1169:                try {
1170:                    return getRemoteScheduler().getPausedTriggerGroups(
1171:                            schedCtxt);
1172:                } catch (RemoteException re) {
1173:                    throw invalidateHandleCreateException(
1174:                            "Error communicating with remote scheduler.", re);
1175:                }
1176:            }
1177:
1178:            /**
1179:             * @see org.quartz.Scheduler#interrupt(java.lang.String, java.lang.String)
1180:             */
1181:            public boolean interrupt(String jobName, String groupName)
1182:                    throws UnableToInterruptJobException {
1183:                try {
1184:                    return getRemoteScheduler().interrupt(schedCtxt, jobName,
1185:                            groupName);
1186:                } catch (RemoteException re) {
1187:                    throw new UnableToInterruptJobException(
1188:                            invalidateHandleCreateException(
1189:                                    "Error communicating with remote scheduler.",
1190:                                    re));
1191:                } catch (SchedulerException se) {
1192:                    throw new UnableToInterruptJobException(se);
1193:                }
1194:            }
1195:
1196:            /**
1197:             * @see org.quartz.Scheduler#setJobFactory(org.quartz.spi.JobFactory)
1198:             */
1199:            public void setJobFactory(JobFactory factory)
1200:                    throws SchedulerException {
1201:                throw new SchedulerException(
1202:                        "Operation not supported for remote schedulers.",
1203:                        SchedulerException.ERR_UNSUPPORTED_FUNCTION_IN_THIS_CONFIGURATION);
1204:            }
1205:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.