1 package org.sapia.magnet.domain; 2 3 import org.sapia.magnet.render.AbstractRenderable; 6 import org.sapia.magnet.render.MagnetContext; 7 import org.sapia.magnet.render.RenderingException; 8 9 10 21 public class LaunchHandlerDef extends AbstractRenderable { 22 23 27 28 private String _theType; 29 30 31 private String _theClassname; 32 33 34 private String _theClasspath; 35 36 40 43 public LaunchHandlerDef() { 44 } 45 46 50 public String getType() { 51 return _theType; 52 } 53 54 public String getClassname() { 55 return _theClassname; 56 } 57 58 public String getClasspath() { 59 return _theClasspath; 60 } 61 62 66 public void setType(String aType) { 67 _theType = aType; 68 } 69 70 public void setClassname(String aClassname) { 71 _theClassname = aClassname; 72 } 73 74 public void setClasspath(String aClasspath) { 75 _theClasspath = aClasspath; 76 } 77 81 87 public void render(MagnetContext aContext) throws RenderingException { 88 try { 90 _theType = resolveValue(aContext, _theType); 91 _theClassname = resolveValue(aContext, _theClassname); 92 _theClasspath = resolveValue(aContext, _theClasspath); 93 94 HandlerFactory.getInstance().addLaunchHandler(_theType, _theClassname); 95 } catch (RenderingException re) { 96 StringBuffer aBuffer = new StringBuffer (); 97 aBuffer.append("Unable to resolve an attribute of the launch handler def "). 98 append(_theType); 99 100 throw new RenderingException(aBuffer.toString(), re); 101 } 102 } 103 104 109 public String toString() { 110 StringBuffer aBuffer = new StringBuffer (super.toString()); 111 aBuffer.append("[type=").append(_theType). 112 append(" classname=").append(_theClassname). 113 append(" classpath=").append(_theClasspath). 114 append("]"); 115 116 return aBuffer.toString(); 117 } 118 } 119 | Popular Tags |