KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > j2ee > blueprints > processmanager > transitions > TransitionDelegateFactory


1
2 /*
3 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Redistribution in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Sun Microsystems, Inc. or the names of
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * This software is provided "AS IS," without a warranty of any
22 * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
23 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
25 * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
26 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
27 * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
28 * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
29 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
30 * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
31 * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
32 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
33 *
34 * You acknowledge that Software is not designed, licensed or intended
35 * for use in the design, construction, operation or maintenance of
36 * any nuclear facility.
37 */

38
39 package com.sun.j2ee.blueprints.processmanager.transitions;
40
41 /**
42  * Used to get the required type of TransitionDelegate
43  */

44 public class TransitionDelegateFactory {
45
46
47   public TransitionDelegateFactory() { }
48
49   public TransitionDelegate getTransitionDelegate(String JavaDoc className) throws TransitionException {
50     TransitionDelegate td = null;
51     try {
52       td = (TransitionDelegate)Class.forName(className).newInstance();
53     } catch(Exception JavaDoc e) {
54       throw new TransitionException(e);
55     }
56     return td;
57   }
58
59 }
60
61
Popular Tags