本文整理汇总了Java中org.mule.api.annotations.lifecycle.Start类的典型用法代码示例。如果您正苦于以下问题:Java Start类的具体用法?Java Start怎么用?Java Start使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Start类属于org.mule.api.annotations.lifecycle包,在下文中一共展示了Start类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.mule.api.annotations.lifecycle.Start; //导入依赖的package包/类
/**
* Start all pub/sub servers.
*
* @throws InterruptedException
*/
@Start
public synchronized void init() throws InterruptedException
{
logger.info("Initialising Netty Publisher");
if (!initialised)
{
startPublisherServers();
initialised = true;
logger.info("Netty Publisher initialised");
}
else
{
logger.info("Netty Publisher was already initialised");
}
}
示例2: login
import org.mule.api.annotations.lifecycle.Start; //导入依赖的package包/类
/**
* Logs in into the NEst service and captures session information
*
* @throws ConnectionException if the credentials are incorrect
* @throws IOException if the response date cannot be parsed
*/
@Start
public void login() throws ConnectionException, IOException
{
httpClient.addFilter(new LoggingFilter());
MultivaluedMap<String, String> map = new MultivaluedMapImpl();
map.putSingle("username", getUsername());
map.putSingle("password", getPassword());
WebResource webResource = httpClient.resource("https://home.nest.com/user/login");
ClientResponse response = webResource.type("application/x-www-form-urlencoded")
.post(ClientResponse.class, map);
if (response.getStatus()> 399)
{
throw new ConnectionException(ConnectionExceptionCode.INCORRECT_CREDENTIALS, "unauthorized user", response.toString());
}
String res = response.getEntity(String.class);
System.out.println("Login: " + res);
login = mapper.readValue(res, Login.class);
baseUri = login.getUrls().getTransportUrl();
getMetaData();
}
示例3: initializeConfiguration
import org.mule.api.annotations.lifecycle.Start; //导入依赖的package包/类
/**
* Perform module initialization.
*/
@Start
public void initializeConfiguration() {
connectorConfigs = new HashMap<String, String>();
connectorConfigs.put("key", apiKey);
if (StringUtils.isBlank(searchEngineId) && StringUtils.isBlank(searchEngineUrl)) {
throw new IllegalArgumentException("You must configure either searchEngineId or searchEngineUrl");
}
if (StringUtils.isNotBlank(searchEngineId) && StringUtils.isNotBlank(searchEngineUrl)) {
throw new IllegalArgumentException("You must configure a reference to the custom search engine.");
}
addIfNotBlank(connectorConfigs, "cx", searchEngineId);
addIfNotBlank(connectorConfigs, "cref", searchEngineUrl);
}
示例4: init
import org.mule.api.annotations.lifecycle.Start; //导入依赖的package包/类
@Start
public void init() throws MuleException {
logger.info("Starting Nuxeo Connector");
if (isConnected() && pendingListeners.size() > 0) {
for (ListenerConfig config : pendingListeners) {
getPollingClient().subscribe(config);
}
introspector = new MetaDataIntrospector(session);
}
}
示例5: connect
import org.mule.api.annotations.lifecycle.Start; //导入依赖的package包/类
/**
* Connect
*
* @throws ConnectionException
*/
@Start
public void connect() throws ConnectionException
{
String res = httpClient.resource(getBaseUri()).get(String.class);
if (res.contains("error"))
{
throw new ConnectionException(ConnectionExceptionCode.INCORRECT_CREDENTIALS, "unauthorized user", res);
}
}
示例6: init
import org.mule.api.annotations.lifecycle.Start; //导入依赖的package包/类
@Start
public void init() {
setClient(new DropboxClient(this));
}