Examples of Api


Examples of in.mDev.MiracleM4n.mChatSuite.api.API

     */
    public void addSetMChatClanTag(Player player, String value)
    {
        if(mchat != null)
        {
            API api = mchat.getAPI();

            api.addPlayerVar(player.getName(), "clan", value);
        }
    }
View Full Code Here

Examples of in.mDev.MiracleM4n.mChatSuite.api.API

     */
    public void clearSetMChatClanTag(Player player)
    {
        if(mchat != null)
        {
            API api = mchat.getAPI();

            api.addPlayerVar(player.getName(), "clan", "");
        }
    }
View Full Code Here

Examples of net.csdn.modules.controller.API

        boolean disableMySql = settings.getAsBoolean(ServiceFramwork.mode + ".datasources.mysql.disable", false);
        systemLog(processInfo.startTime, request, settings, processInfo);
        endORM(disableMySql);
        closeTx(settings, processInfo);
        Trace.clean();
        API api = ServiceFramwork.injector.getInstance(API.class);
        api.statusIncrement(processInfo.method, processInfo.status);
        api.averageTimeIncrement(processInfo.method, System.currentTimeMillis() - processInfo.startTime);
    }
View Full Code Here

Examples of net.csdn.modules.controller.API

                    Method[] methods = clzz.getDeclaredMethods();

                    for (Method method : methods) {
                        if (method.getModifiers() == Modifier.PRIVATE) continue;
                        RestController restController = ServiceFramwork.injector.getInstance(RestController.class);
                        API api = ServiceFramwork.injector.getInstance(API.class);
                        NoAction noAction = method.getAnnotation(NoAction.class);
                        if (noAction != null) {
                            restController.setDefaultHandlerKey(new Tuple<Class<ApplicationController>, Method>(clzz, method));
                        }

                        ErrorAction errorAction = method.getAnnotation(ErrorAction.class);
                        if (errorAction != null) {
                            restController.setErrorHandlerKey(new Tuple<Class<ApplicationController>, Method>(clzz, method));
                        }

                        At at = method.getAnnotation(At.class);
                        if (at == null) continue;
                        String url = at.path()[0];
                        RestRequest.Method[] httpMethods = at.types();

                        for (RestRequest.Method httpMethod : httpMethods) {
                            Tuple<Class<ApplicationController>, Method> tuple = new Tuple<Class<ApplicationController>, Method>(clzz, method);
                            restController.registerHandler(httpMethod, url, tuple);
                            api.addPath(tuple.v2());
                        }
                        bind(clzz);
                    }
                } catch (Exception e) {
                    logger.error(CError.SystemInitializeError, e);
View Full Code Here

Examples of oauthP5.apis.Api

  }

  private Api createApi(Class<? extends Api> apiClass)
  {
    Preconditions.checkNotNull(apiClass, "Api class cannot be null");
    Api api;
    try
    {
      api = apiClass.newInstance()
    }
    catch(Exception e)
View Full Code Here

Examples of org.apache.deltacloud.client.API

*/
public class APIDomUnmarshallingTest {

  @Test
  public void ec2DriverIsUnmarshalled() throws MalformedURLException, DeltaCloudClientException {
    API api = new API();
    ByteArrayInputStream inputStream = new ByteArrayInputStream(APIResponse.apiResponse.getBytes());
    new APIUnmarshaller().unmarshall(inputStream, api);
    assertNotNull(api);
    assertEquals(APIResponse.driver, api.getDriver().name().toLowerCase());
  }
View Full Code Here

Examples of org.apache.synapse.rest.API

    public API getAPI(String name) {
        return apiTable.get(name);
    }

    public void removeAPI(String name) {
        API api = apiTable.get(name);
        if (api != null) {
            apiTable.remove(name);
        } else {
            handleException("No API exists by the name: " + name);
        }
View Full Code Here

Examples of org.apache.synapse.rest.API

        OMAttribute contextAtt = apiElt.getAttribute(new QName("context"));
        if (contextAtt == null || "".equals(contextAtt.getAttributeValue())) {
            handleException("Attribute 'context' is required for an API definition");
        }

        API api = new API(nameAtt.getAttributeValue(), contextAtt.getAttributeValue());

        OMAttribute hostAtt = apiElt.getAttribute(new QName("hostname"));
        if (hostAtt != null && !"".equals(hostAtt.getAttributeValue())) {
            api.setHost(hostAtt.getAttributeValue());
        }

        OMAttribute portAtt = apiElt.getAttribute(new QName("port"));
        if (portAtt != null && !"".equals(portAtt.getAttributeValue())) {
            api.setPort(Integer.parseInt(portAtt.getAttributeValue()));
        }

        Iterator resources = apiElt.getChildrenWithName(new QName(
                XMLConfigConstants.SYNAPSE_NAMESPACE, "resource"));
        boolean noResources = true;
        while (resources.hasNext()) {
            OMElement resourceElt = (OMElement) resources.next();
            api.addResource(ResourceFactory.createResource(resourceElt));
            noResources = false;
        }

        if (noResources) {
            handleException("An API must contain at least one resource definition");
View Full Code Here

Examples of org.apache.synapse.rest.API

        if (log.isDebugEnabled()) {
            log.debug("API deployment from file : " + fileName + " : Started");
        }

        try {
            API api = APIFactory.createAPI(artifactConfig);
            if (api != null) {
                api.setFileName((new File(fileName)).getName());
                if (log.isDebugEnabled()) {
                    log.debug("API named '" + api.getName()
                            + "' has been built from the file " + fileName);
                }
                api.init(getSynapseEnvironment());
                if (log.isDebugEnabled()) {
                    log.debug("Initialized the API: " + api.getName());
                }
                getSynapseConfiguration().addAPI(api.getName(), api);
                if (log.isDebugEnabled()) {
                    log.debug("API deployment from file : " + fileName + " : Completed");
                }
                log.info("API named '" + api.getName() +
                        "' has been deployed from file : " + fileName);
                return api.getName();
            } else {
                handleSynapseArtifactDeploymentError("API deployment Failed. The artifact " +
                        "described in the file " + fileName + " is not a valid API");
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.synapse.rest.API

        if (log.isDebugEnabled()) {
            log.debug("API update from file : " + fileName + " has started");
        }

        try {
            API api = APIFactory.createAPI(artifactConfig);
            if (api == null) {
                handleSynapseArtifactDeploymentError("API update failed. The artifact " +
                        "defined in the file: " + fileName + " is not a valid API.");
                return null;
            }
            api.setFileName(new File(fileName).getName());

            if (log.isDebugEnabled()) {
                log.debug("API: " + api.getName() + " has been built from the file: " + fileName);
            }

            api.init(getSynapseEnvironment());
            API existingAPI = getSynapseConfiguration().getAPI(existingArtifactName);
            if (existingArtifactName.equals(api.getName())) {
                getSynapseConfiguration().updateAPI(existingArtifactName, api);
            } else {
                // The user has changed the name of the API
                // We should add the updated API as a new API and remove the old one
                getSynapseConfiguration().addAPI(api.getName(), api);
                getSynapseConfiguration().removeAPI(existingArtifactName);
                log.info("API: " + existingArtifactName + " has been undeployed");
            }

            log.info("API: " + api.getName() + " has been updated from the file: " + fileName);

            waitForCompletion();
            existingAPI.destroy();
            return api.getName();

        } catch (DeploymentException e) {
            handleSynapseArtifactDeploymentError("Error while updating the API from the " +
                    "file: " + fileName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.