本文整理汇总了Java中javax.ejb.FinderException类的典型用法代码示例。如果您正苦于以下问题:Java FinderException类的具体用法?Java FinderException怎么用?Java FinderException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FinderException类属于javax.ejb包,在下文中一共展示了FinderException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ScriptJsfBean
import javax.ejb.FinderException; //导入依赖的package包/类
/** Creates a new instance of ScriptJsfBean */
public ScriptJsfBean() {
String name = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("scriptname");
if (name != null) {
this.name = name;
try {
ScriptLocal s = Ejb.lookupScriptBean().findByPrimaryKey(name);
description = s.getDescription();
text = new String(s.getScript());
} catch (FinderException ex) {
//Logger.getLogger(ScriptJsfBean.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:17,代码来源:ScriptJsfBean.java
示例2: load
import javax.ejb.FinderException; //导入依赖的package包/类
public String load() {
try {
DeviceProfileLocal d = Ejb.lookupDeviceProfileBean().findByPrimaryKey(name);
setPeriodicInformInterval(d.getInforminterval());
setDaysToKeepStats(d.getDayskeepstats());
setSaveParamValuesInterval(d.getSaveParamValuesInterval());
saveParamValuesOnBoot = d.getSaveParamValuesOnBoot();
saveParamValuesOnChange = d.getSaveParamValuesOnChange();
saveLog = d.getSaveLog();
saveParamValues = d.getSaveParamValues();
scriptName = d.getScriptname();
props = new ProfilePropertySet(name);
props.Load();
return "loaded";
} catch (FinderException ex) {
setErrorMessage(ex.getMessage());
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:21,代码来源:DeviceProfileBean.java
示例3: getFwVersions
import javax.ejb.FinderException; //导入依赖的package包/类
public Collection getFwVersions() {
// javax.faces.context.FacesContext.getCurrentInstance().
//System.out.println("DeviceProfileBean.getFwVersions hwid=" + hwid);
ArrayList<SelectItem> a = new ArrayList<SelectItem>();
a.add(new SelectItem(DeviceProfile2SoftwareLocal.NOUPDATE, "No update"));
a.add(new SelectItem(DeviceProfile2SoftwareLocal.AUTOUPDATE, "Automatic"));
try {
// Iterator cfgs = Ejb.lookupConfigurationBean().findAll().iterator();
Iterator<SoftwareLocal> fws = Ejb.lookupSoftwareBean().findByHardware(hwid).iterator();
while (fws.hasNext()) {
SoftwareLocal fw = fws.next();
a.add(new SelectItem(fw.getVersion(), fw.getVersion()));
}
} catch (FinderException ex) {
}
return a;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:18,代码来源:DeviceProfileBean.java
示例4: load
import javax.ejb.FinderException; //导入依赖的package包/类
public String load() {
try {
ServiceLocal svc = Ejb.lookupServiceBean().findByPrimaryKey(id);
name = svc.getName();
description = svc.getDescription();
type = svc.getType();
props = new ServicePropertySet(id);
props.Load();
if (type == null || type.equals("") || type.equals(TYPE_GENERIC)) {
System.out.println("ServiceBean::load return \"loaded_service\"");
return "loaded_service";
}
System.out.println("ServiceBean::load return \"loaded_" + type + "\"");
return "loaded_" + type;
} catch (FinderException ex) {
setErrorMessage(ex.getMessage());
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:22,代码来源:ServiceBean.java
示例5: Load
import javax.ejb.FinderException; //导入依赖的package包/类
@Override
public void Load() {
//System.out.println ("ProfilePropertySet::Load name="+profilename);
ProfilePropertyLocalHome pplh = Ejb.lookupProfilePropertyBean();
Collection<ProfilePropertyLocal> props;
try {
props = pplh.findByProfile(profilename);
for (ProfilePropertyLocal p : props) {
//System.out.println ("ProfilePropertySet::Load "+p.getName()+"->"+p.getValue());
original.put(p.getName(), new Property(p.getName(), p.getValue()));
}
super.Load();
} catch (FinderException ex) {
//System.out.println ("ProfilePropertySet::Load ex="+ex.getMessage());
}
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:17,代码来源:ProfilePropertySet.java
示例6: call
import javax.ejb.FinderException; //导入依赖的package包/类
public static Object call(Context cx, Scriptable thisObj, Object[] args, Function funObj) {
if (args.length < 1) {
((Script) thisObj).log(Level.WARNING, "call function with zero args");
return null;
}
ScriptLocal script;
try {
script = Ejb.lookupScriptBean((String) args[0]);
/*
Object [] newargs = null;
if (args.length > 1) {
newargs = new Object[args.length - 1];
System.arraycopy(args, 1, newargs, 0, args.length - 1);
Scriptable a = cx.newArray(thisObj, newargs);
thisObj.put("arguments", thisObj, newargs);
}
*/
return cx.evaluateString(thisObj, new String(script.getScript()), (String) args[0], 1, null);
} catch (FinderException ex) {
((Script) thisObj).log(Level.SEVERE, "CALL: function " + args[0] + " not found.");
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:24,代码来源:Script.java
示例7: createDefaultProfile
import javax.ejb.FinderException; //导入依赖的package包/类
private void createDefaultProfile() {
DeviceProfileLocal def;
try {
def = Ejb.lookupDeviceProfileBean().findByPrimaryKey("Default");
if (def.getSaveParamValuesOnBoot() == null) {
def.setSavestats(true);
def.setSaveParamValuesOnChange(true);
def.setSaveParamValuesOnBoot(true);
def.setSaveParamValuesInterval(7);
}
} catch (FinderException ex) {
try {
def = Ejb.lookupDeviceProfileBean().create("Default");
def.setDayskeepstats(7);
def.setInforminterval(1800);
def.setSavestats(true);
def.setSaveParamValuesOnChange(true);
def.setSaveParamValuesOnBoot(true);
def.setSaveParamValuesInterval(7);
} catch (CreateException ex1) {
Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex1);
}
}
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:25,代码来源:Application.java
示例8: Save
import javax.ejb.FinderException; //导入依赖的package包/类
public String Save() {
// System.out.println ("Config.Save: hwid="+hwid+" name="+name);
try {
ConfigurationLocal s = Ejb.lookupConfigurationBean().findByPrimaryKey(new ConfigurationPK(hwid, name));
HardwareModelLocal hw = s.getHardware();
Vendor v = Vendor.getVendor(hw.getOui(), hw.getHclass(), hw.getVersion());
String[] r = v.CheckConfig(filename, name, version, config);
if (r != null && r.length > 0) {
setErrorMessage(r);
}
s.setFilename(filename);
s.setVersion(version);
s.setConfig(config.getBytes());
setSaved();
} catch (FinderException ex) {
setErrorMessage(ex.getMessage());
}
return "cfgsaved";
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:21,代码来源:ConfigJsfBean.java
示例9: connectionRequest
import javax.ejb.FinderException; //导入依赖的package包/类
public String connectionRequest() {
if (crw == null || crw.getState() == State.TERMINATED) {
try {
System.out.println("Connection request START");
HostsLocal h = Ejb.lookupHostsBean().findByHwidAndSn(hwid, sn);
// crw = new ConnectionRequestWorker(url, conreqUser, conreqPass);
crw = new ConnectionRequestWorker(h);
setLastcrres("In progress");
crw.start();
} catch (FinderException ex) {
System.out.println("FinderException: " + ex.getLocalizedMessage());
setLastcrres(ex.getLocalizedMessage());
Logger.getLogger(HostsBean.class.getName()).log(Level.SEVERE, null, ex);
}
} else {
System.out.println("Connection request no......");
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:20,代码来源:HostsBean.java
示例10: getConfigs
import javax.ejb.FinderException; //导入依赖的package包/类
public Collection getConfigs() {
try {
// Iterator cfgs = Ejb.lookupConfigurationBean().findAll().iterator();
Iterator cfgs = Ejb.lookupConfigurationBean().findByHwid(hwid).iterator();
ArrayList<SelectItem> a = new ArrayList<SelectItem>();
a.add(new SelectItem(CONFIG_NONE));
while (cfgs.hasNext()) {
ConfigurationLocal cfg = (ConfigurationLocal) cfgs.next();
a.add(new SelectItem(cfg.getName()));
}
return a;
} catch (FinderException ex) {
ex.printStackTrace();
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:17,代码来源:HostsBean.java
示例11: getHardwareList
import javax.ejb.FinderException; //导入依赖的package包/类
public Collection getHardwareList() {
try {
Iterator cfgs = Ejb.lookupHardwareModelBean().findAll().iterator();
ArrayList<SelectItem> a = new ArrayList<SelectItem>();
while (cfgs.hasNext()) {
HardwareModelLocal model = (HardwareModelLocal) cfgs.next();
a.add(new SelectItem(((Integer) model.getId()).toString(), model.getDisplayName()));
if (hwid == null) {
hwid = (Integer) model.getId();
}
}
return a;
} catch (FinderException ex) {
ex.printStackTrace();
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:18,代码来源:HostsBean.java
示例12: getServiceForm
import javax.ejb.FinderException; //导入依赖的package包/类
protected String getServiceForm() {
ServiceLocal service;
try {
service = Ejb.lookupServiceBean().findByPrimaryKey(svcidin);
} catch (FinderException ex) {
Logger.getLogger(HostsBean.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
String formname = service.getType() + "_assign.xhtml";
try {
InputStream rs = FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream(formname);
if (rs != null) {
return service.getType();
}
} catch (Exception e) {
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:19,代码来源:HostsBean.java
示例13: autocompleteSerialNo
import javax.ejb.FinderException; //导入依赖的package包/类
public Collection autocompleteSerialNo(Object v) {
//System.out.println ("CPE autocompleteSerialNo");
ArrayList<String> a = new ArrayList<String>(COUNT_SUGGESTIONS);
Iterator it;
try {
//System.out.println ("AUTOCOMPLETE hwid="+hwid+" v="+v);
it = Ejb.lookupHostsBean().findByPartialSN(hwid, (String) v).iterator();
} catch (FinderException ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
for (int i = 0; i < COUNT_SUGGESTIONS && it.hasNext(); i++) {
a.add(i, ((HostsLocal) it.next()).getSerialno());
}
return a;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:17,代码来源:HostsBean.java
示例14: getCfg
import javax.ejb.FinderException; //导入依赖的package包/类
private DataModelNode getCfg() {
if (thecfg == null) {
parameterNames = null;
parameterValues = null;
currentPath = "";
thecfg = new DataModelNode(null);
InputStream in;
try {
//in = new FileInputStream("c:/temp/tr.txt");
BackupLocalHome blh = Ejb.lookupBackupBean();
Timestamp t = blh.getTimeOfLastBackup(id);
BackupLocal bl = blh.findByPrimaryKey(new BackupPK(id, t, BackupLocal.TYPE_VENDOR_INDEPENDANT));
in = new ByteArrayInputStream(bl.getCfg());
thecfg.load(in);
setPath(currentPath = thecfg.getName());
} /*catch (FileNotFoundException ex) {
Logger.getLogger(HostsBean.class.getName()).log(Level.SEVERE, null, ex);
}*/ catch (FinderException ex) {
setErrorMessage("No saved values found. \nCheck settings in profile or wait for device contacting ACS.");
// Logger.getLogger(HostsBean.class.getName()).log(Level.SEVERE, null, ex);
}
}
return thecfg;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:26,代码来源:HostsBean.java
示例15: getAtmErrorStats
import javax.ejb.FinderException; //导入依赖的package包/类
private Hashtable<String, String> getAtmErrorStats(Hashtable<String, String> m, int type) {
if (m == null) {
HostsLocal h;
try {
h = Ejb.lookupHostsBean().findByHwidAndSn(hwid, sn);
ATMErrorsStatsLocal s = Ejb.lookupATMErrorsStatsBean().findByPrimaryKey(new ATMErrorsStatsPK((Integer) h.getId(), h.getLastcontact(), type));
m = ejb2map(s);
m.remove("hostid");
m.remove("time");
m.remove("type");
} catch (FinderException ex) {
m = new Hashtable<String, String>();
}
}
return m;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:18,代码来源:HostsBean.java
示例16: Save
import javax.ejb.FinderException; //导入依赖的package包/类
public String Save() {
// System.out.println("ScriptJsfBean.Save () id=" + id);
try {
HardwareModelLocal s = Ejb.lookupHardwareModelBean().findByPrimaryKey(id);
s.setDisplayName(displayName);
s.setHclass(hclass);
s.setManufacturer(manufacturer);
s.setOui(oui);
s.setVersion(version);
} catch (FinderException ex) {
setErrorMessage(ex.getMessage());
return null;
}
setSaved();
return "hwsaved";
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:17,代码来源:HwModelJsfBean.java
示例17: getProfileProps
import javax.ejb.FinderException; //导入依赖的package包/类
private boolean getProfileProps(Properties p, String root, String profile, Hashtable<String, Boolean> profiles) throws FinderException {
if (profiles.containsKey(profile)) {
return false;
}
profiles.put(profile, true);
DeviceProfileLocal prf = Ejb.lookupDeviceProfileBean().findByPrimaryKey(profile);
String baseprofile = prf.getBaseprofile();
if (baseprofile != null && !baseprofile.equals("")) {
boolean r = getProfileProps(p, root, baseprofile, profiles);
if (!r) {
return false;
}
}
String profilename = prf.getName();
Iterator<ProfilePropertyLocal> profileprops = Ejb.lookupProfilePropertyBean().findByProfile(profile).iterator();// prf.getProperties().iterator();
while (profileprops.hasNext()) {
ProfilePropertyLocal profileprop = profileprops.next();
String name = profileprop.getName();
String value = profileprop.getValue();
log(Level.INFO, "Set property: source is profile '" + profilename + "' " + name + " -> " + value);
putNormalizedProperty(p, root, name, value);
//p.setProperty(name, value);
}
return true;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:27,代码来源:Configurator.java
示例18: getAll
import javax.ejb.FinderException; //导入依赖的package包/类
public Object[] getAll() throws FinderException {
// System.out.println ("ScriptJsfBean.getAll");
if (arrayScriptNames != null) {
return arrayScriptNames;
} else {
return arrayScriptNames = Ejb.lookupScriptBean().findAll().toArray();
}
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:9,代码来源:ScriptJsfBean.java
示例19: getAll
import javax.ejb.FinderException; //导入依赖的package包/类
public Object[] getAll() throws FinderException {
if (arraySw != null) {
return arraySw;
} else {
return arraySw = Ejb.lookupSoftwareBean().findAll().toArray();
}
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:8,代码来源:SoftwaresBean.java
示例20: save
import javax.ejb.FinderException; //导入依赖的package包/类
public String save() {
try {
save(Ejb.lookupDeviceProfileBean().findByPrimaryKey(name));
setSaved();
return "saved";
} catch (FinderException ex) {
setErrorMessage(ex.getMessage());
}
return null;
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:11,代码来源:DeviceProfileBean.java
注:本文中的javax.ejb.FinderException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论