本文整理汇总了Java中org.fosstrak.ale.client.exception.FosstrakAleClientException类的典型用法代码示例。如果您正苦于以下问题:Java FosstrakAleClientException类的具体用法?Java FosstrakAleClientException怎么用?Java FosstrakAleClientException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FosstrakAleClientException类属于org.fosstrak.ale.client.exception包,在下文中一共展示了FosstrakAleClientException类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Configuration
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* construct a new configuration. if the command line provides a
* configuration file, then this file is used. otherwise the default
* property from the jar is used.
* @param cmdLine the command line array.
* @throws FosstrakAleClientException when the configuration could not be obtained.
*/
private Configuration(String[] cmdLine) throws FosstrakAleClientException {
String file = PROPERTIES_FILE_LOCATION;
if (cmdLine.length > 0) file = cmdLine[0];
s_log.info(String.format("using configuration file '%s'", file));
// load properties
InputStream inputStream = this.getClass().getResourceAsStream(file);
try {
m_properties = new Properties();
m_properties.load(inputStream);
} catch (Exception e) {
m_properties = null;
s_log.error(String.format("could not load configuration file '%s'", file));
throw new FosstrakAleClientException(e);
}
}
示例2: getProxy
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* @return the proxy object. if null, display the connect dialog.
*/
protected Object getProxy() throws FosstrakAleClientException {
if (null == m_proxy) {
// display the connect dialog
String address = FosstrakAleClient.instance().showConnectDialog(m_endpointKey);
// create the proxy object.
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(m_clzz);
factory.setAddress(address);
m_proxy = factory.create();
// we try to perform a test method call.
// if that call fails, we assume the connection to be daad.
try {
m_testMethod.invoke(m_proxy, m_testMethodParameter);
} catch (Exception e) {
m_proxy = null;
throw new FosstrakAleClientServiceDownException(e);
}
}
return m_proxy;
}
示例3: main
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* @param args command line arguments.
*/
public static void main(String[] args) throws FosstrakAleClientException {
for (String arg : args) {
if ("help".equalsIgnoreCase(arg)) help();
if ("-h".equalsIgnoreCase(arg)) help();
if ("--help".equalsIgnoreCase(arg)) help();
}
// configure Logger with properties file
try {
Properties p = new Properties();
p.load(FosstrakAleClient.class.getResourceAsStream("/log4j.properties"));
PropertyConfigurator.configure(p);
s_log.debug("configured the logger.");
} catch (Exception e) {
s_log.info("Could not configure the logger.");
}
s_log.debug("preparing client for execution.");
FosstrakAleClient.instance().configure(Configuration.getConfiguration(args));
s_log.debug("executing client.");
FosstrakAleClient.instance().execute();
}
示例4: initialize
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* This method initializes the class, by loading properties and texts.
*
* @throws FosstrakAleClientException when the language files could not be loaded.
*/
public void initialize() throws FosstrakAleClientException {
String baseNameKey = getBaseNameKey();
try {
// get the base name (eg /props/ALEClient
String baseName = FosstrakAleClient.instance().getConfiguration().getProperty(baseNameKey);
// load text
InputStream languageStream = null;
// try to get language form property file
String language = FosstrakAleClient.instance().getConfiguration().getLanguage();
if (null != language) {
languageStream = this.getClass().getResourceAsStream(String.format("%s_%s.lang", baseName, language));
}
// try system default language
if (languageStream == null) {
languageStream = this.getClass().getResourceAsStream(String.format("%s_%s.lang", baseName, SYSTEM_DEFAULT_LOCALE.getLanguage()));
}
// try default language
if (languageStream == null) {
languageStream = this.getClass().getResourceAsStream(String.format("%s_%s.lang", baseName, DEFAULT_LOCALE.getLanguage()));
}
if (languageStream == null) {
throw new IllegalArgumentException("Could not load language package from classpath (" + DEFAULT_LOCALE + ")");
}
m_guiText = new PropertyResourceBundle(languageStream);
initializeGUI();
} catch (Exception e) {
throw new FosstrakAleClientException(e);
}
}
示例5: instance
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* @return handle to the singleton of the ale client.
*/
public static FosstrakAleClient instance() {
if (null == s_instance) {
try {
s_instance = new FosstrakAleClient();
} catch (FosstrakAleClientException e) {
e.printStackTrace();
System.exit(-1);
}
}
return s_instance;
}
示例6: execute
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* starts up the sink.
* @param url the url of the event sink.
* @throws FosstrakAleClientException upon error in startup procedure.
*/
public void execute(URL url) throws FosstrakAleClientException {
EventSink sink = new EventSink(url.toString());
add(sink);
setSize(FosstrakAleClient.instance().getConfiguration().getWindowSize());
setResizable(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
示例7: getAleServiceProxy
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* @return returns the proxy object already casted.
*/
protected ALEServicePortType getAleServiceProxy() throws FosstrakAleClientException {
return (ALEServicePortType) getProxy();
}
示例8: getAleLRServiceProxy
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* @return returns the proxy object already casted.
*/
protected ALELRServicePortType getAleLRServiceProxy() throws FosstrakAleClientException {
return (ALELRServicePortType) getProxy();
}
示例9: getAleServiceProxy
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* @return returns the proxy object already casted.
*/
protected ALECCServicePortType getAleServiceProxy() throws FosstrakAleClientException {
return (ALECCServicePortType) getProxy();
}
示例10: getAletmServiceProxy
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* @return returns the proxy object already casted.
*/
protected ALETMServicePortType getAletmServiceProxy() throws FosstrakAleClientException {
return (ALETMServicePortType) getProxy();
}
示例11: getConfiguration
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* reads the configuration from a configuration given by the command line.
* @param cmdLine the command line arguments.
* @return a configuration
* @throws FosstrakAleClientException when the configuration could not be obtained.
*/
public static Configuration getConfiguration(String[] cmdLine) throws FosstrakAleClientException {
return new Configuration(cmdLine);
}
示例12: getConfigurtionDefaultConfig
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* reads the default configuration file
* @return a configuration
* @throws FosstrakAleClientException when the configuration could not be obtained.
*/
public static Configuration getConfigurtionDefaultConfig() throws FosstrakAleClientException {
return getConfiguration(new String[] {} );
}
示例13: configure
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* allows to configure the client.
* @param cfg the configuration object.
* @throws FosstrakAleClientException upon error in startup procedure.
*/
public void configure(Configuration cfg) throws FosstrakAleClientException {
m_configuration = cfg;
}
示例14: FosstrakAleClient
import org.fosstrak.ale.client.exception.FosstrakAleClientException; //导入依赖的package包/类
/**
* private constructor for the singleton.
* @throws FosstrakAleClientException upon start problems.
*/
private FosstrakAleClient() throws FosstrakAleClientException {
}