@Test public void testGetSupportedModelRelativePath() { SwitchyardRoleSimulator sim=new SwitchyardRoleSimulator(); try { SimulationModel simmodel=new SimulationModel("descriptors/java/store/switchyard.xml",null); Object model=sim.getModel(simmodel, null); if (model == null) { fail("Model is null"); } else if (!(model instanceof java.io.File)) { fail("Model not a file"); } } catch(Exception e) { fail("Exception occurred: "+e); } }
public Object getModel(SimulationModel model, ResourceLocator locator) { Object ret=null; if (model.getName().endsWith(SWITCHYARD_DESCRIPTOR)) { try { ret = new java.io.File(model.getName()); if (!((java.io.File)ret).exists()) { ret = null; java.net.URL url=Thread.currentThread().getContextClassLoader().getResource(model.getName()); if (url != null) { ret = new java.io.File(url.getFile()); if (!((java.io.File)ret).exists()) { ret = null; } } } } catch(Throwable e) { LOG.log(Level.SEVERE, "Failed to load Switchyard descriptor model", e); } } return(ret); }
SwitchyardRoleSimulator implements RoleSimulator { public Object getModel(SimulationModel model, ResourceLocator locator) { Object ret=null; if (model.getName().endsWith(SWITCHYARD_DESCRIPTOR)) { try { ret = new java.io.File(model.getName()); if (!((java.io.File)ret).exists()) { ret = null; java.net.URL url=Thread.currentThread().getContextClassLoader().getResource(model.getName()); if (url != null) { ret = new java.io.File(url.getFile()); if (!((java.io.File)ret).exists()) { ret = null; } } } } catch(Throwable e) { LOG.log(Level.SEVERE, "Failed to load Switchyard descriptor model", e); } } return(ret); } }
SwitchyardRoleSimulator implements RoleSimulator { public Object getModel(SimulationModel model, ResourceLocator locator) { Object ret=null; if (model.getName().endsWith(SWITCHYARD_DESCRIPTOR)) { try { ret = new java.io.File(model.getName()); if (!((java.io.File)ret).exists()) { ret = null; java.net.URL url=Thread.currentThread().getContextClassLoader().getResource(model.getName()); if (url != null) { ret = new java.io.File(url.getFile()); if (!((java.io.File)ret).exists()) { ret = null; } } } } catch(Throwable e) { LOG.log(Level.SEVERE, "Failed to load Switchyard descriptor model", e); } } return(ret); }  }
SwitchyardRoleSimulator implements RoleSimulator { public Object getModel(SimulationModel model, ResourceLocator locator) { Object ret=null; if (model.getName().endsWith(SWITCHYARD_DESCRIPTOR)) { try { ret = new java.io.File(model.getName()); if (!((java.io.File)ret).exists()) { ret = null; java.net.URL url=Thread.currentThread().getContextClassLoader().getResource(model.getName()); if (url != null) { ret = new java.io.File(url.getFile()); if (!((java.io.File)ret).exists()) { ret = null; } } } } catch(Throwable e) { LOG.log(Level.SEVERE, "Failed to load Switchyard descriptor model", e); } } return(ret); }  String getName(); void initialize(SimulationContext context); boolean isSupported(SimulationModel model); Object getModel(SimulationModel model, ResourceLocator locator); List<Role> getModelRoles(Object model); Object getModelForRole(Object model, Role role, ResourceLocator locator); void onEvent(SimulationContext context, final Event event,
					final SimulationHandler handler); void close(SimulationContext context); }
SwitchyardRoleSimulator implements RoleSimulator { public Object getModel(SimulationModel model, ResourceLocator locator) { Object ret=null; if (model.getName().endsWith(SWITCHYARD_DESCRIPTOR)) { try { ret = new java.io.File(model.getName()); if (!((java.io.File)ret).exists()) { ret = null; java.net.URL url=Thread.currentThread().getContextClassLoader().getResource(model.getName()); if (url != null) { ret = new java.io.File(url.getFile()); if (!((java.io.File)ret).exists()) { ret = null; } } } } catch(Throwable e) { LOG.log(Level.SEVERE, "Failed to load Switchyard descriptor model", e); } } return(ret); }  String getName(); void initialize(SimulationContext context); boolean isSupported(SimulationModel model); Object getModel(SimulationModel model, ResourceLocator locator); List<Role> getModelRoles(Object model); Object getModelForRole(Object model, Role role, ResourceLocator locator); void onEvent(SimulationContext context, final Event event,
					final SimulationHandler handler); void close(SimulationContext context);  }