当前位置: 首页>>代码示例>>Java>>正文


Java Start类代码示例

本文整理汇总了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");
    }
}
 
开发者ID:Ricston,项目名称:mule-transport-netty-publisher,代码行数:21,代码来源:NettyPublisherConnector.java

示例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();
}
 
开发者ID:mulesoft-labs,项目名称:nest-connector,代码行数:32,代码来源:NestConnector.java

示例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);
}
 
开发者ID:juancavallotti,项目名称:mule-module-google-custom-search,代码行数:21,代码来源:GoogleSearchModule.java

示例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);
    }
}
 
开发者ID:tiry,项目名称:nuxeo-mule-connector,代码行数:11,代码来源:NuxeoConnector.java

示例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);
    }
}
 
开发者ID:mulesoft-labs,项目名称:hue-connector,代码行数:15,代码来源:HueConnector.java

示例6: init

import org.mule.api.annotations.lifecycle.Start; //导入依赖的package包/类
@Start
public void init() {
    setClient(new DropboxClient(this));
}
 
开发者ID:mulesoft-labs,项目名称:devkit-documentation-rest-jersey,代码行数:5,代码来源:RestJerseyConnector.java


注:本文中的org.mule.api.annotations.lifecycle.Start类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。