congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ServicesConfig.findDestinationById
Code IndexAdd Tabnine to your IDE (free)

How to use
findDestinationById
method
in
org.granite.config.flex.ServicesConfig

Best Java code snippets using org.granite.config.flex.ServicesConfig.findDestinationById (Showing top 12 results out of 315)

origin: org.graniteds/granite-server

@Override
public ServiceInvoker<?> getServiceInstance(RemotingMessage request) throws ServiceException {
  String messageType = request.getClass().getName();
  String destinationId = request.getDestination();
  GraniteContext context = GraniteContext.getCurrentInstance();
  Map<String, Object> cache = context.getApplicationMap();
  Destination destination = ((ServicesConfig)context.getServicesConfig()).findDestinationById(messageType, destinationId);
  String key = TideServiceInvoker.class.getName() + '.' + destinationId;
  return getServiceInvoker(cache, destination, key);
}
origin: org.graniteds/granite-server-ejb

@Override
public ServiceInvoker<?> getServiceInstance(RemotingMessage request) throws ServiceException {
  String messageType = request.getClass().getName();
  String destinationId = request.getDestination();
  GraniteContext context = GraniteContext.getCurrentInstance();
  Map<String, Object> cache = context.getSessionMap();
  Destination destination = ((ServicesConfig)context.getServicesConfig()).findDestinationById(messageType, destinationId);
  String key = TideServiceInvoker.class.getName() + '.' + destinationId;
  return getServiceInvoker(cache, destination, key);
}
origin: org.graniteds/granite-server

@Override
public ServiceInvoker<?> getServiceInstance(RemotingMessage request) throws ServiceException {
  String messageType = request.getClass().getName();
  String destinationId = request.getDestination();
  GraniteContext context = GraniteContext.getCurrentInstance();
  Destination destination = ((ServicesConfig)context.getServicesConfig()).findDestinationById(messageType, destinationId);
  if (destination == null)
    throw new ServiceException("No matching destination: " + destinationId);
  destination.addRemoveListener(this);
  Map<String, Object> cache = getCache(destination);
  
  String key = SimpleServiceInvoker.class.getName() + '.' + destination.getId();
  if (invalidKeys.contains(key)) {
    cache.remove(key);
    invalidKeys.remove(key);
  }
  
  SimpleServiceInvoker service = (SimpleServiceInvoker)cache.get(key);
  if (service == null) {
    service = new SimpleServiceInvoker(destination, this);
    cache.put(key, service);
  }
  return service;
}
 
origin: org.graniteds/granite-client

@Override
public ServiceInvoker<?> getServiceInstance(RemotingMessage request) throws ServiceException {
  String messageType = request.getClass().getName();
  String destinationId = request.getDestination();
  GraniteContext context = GraniteContext.getCurrentInstance();
  Destination destination = context.getServicesConfig().findDestinationById(messageType, destinationId);
  if (destination == null)
    throw new ServiceException("No matching destination: " + destinationId);
  destination.addRemoveListener(this);
  Map<String, Object> cache = getCache(destination);
  
  String key = SimpleServiceInvoker.class.getName() + '.' + destination.getId();
  if (invalidKeys.contains(key)) {
    cache.remove(key);
    invalidKeys.remove(key);
  }
  
  SimpleServiceInvoker service = (SimpleServiceInvoker)cache.get(key);
  if (service == null) {
    service = new SimpleServiceInvoker(destination, this);
    cache.put(key, service);
  }
  return service;
}
 
origin: org.graniteds/granite-server

public static ServiceFactory getFactoryInstance(RemotingMessage request) throws ServiceException {
  GraniteContext context = GraniteContext.getCurrentInstance();
  String messageType = request.getClass().getName();
  String destinationId = request.getDestination();
  log.debug(">> Finding factoryId for messageType: %s and destinationId: %s", messageType, destinationId);
  Destination destination = ((ServicesConfig)context.getServicesConfig()).findDestinationById(messageType, destinationId);
  if (destination == null)
    throw new ServiceException("Destination not found: " + destinationId);
  String factoryId = destination.getProperties().get("factory");
  log.debug(">> Found factoryId: %s", factoryId);
  Map<String, Object> cache = context.getApplicationMap();
  String key = ServiceFactory.class.getName() + '.' + factoryId;
  return getServiceFactory(cache, context, factoryId, key);
}
origin: org.graniteds/granite-client

public static ServiceFactory getFactoryInstance(RemotingMessage request) throws ServiceException {
  GraniteContext context = GraniteContext.getCurrentInstance();
  String messageType = request.getClass().getName();
  String destinationId = request.getDestination();
  log.debug(">> Finding factoryId for messageType: %s and destinationId: %s", messageType, destinationId);
  Destination destination = context.getServicesConfig().findDestinationById(messageType, destinationId);
  if (destination == null)
    throw new ServiceException("Destination not found: " + destinationId);
  String factoryId = destination.getProperties().get("factory");
  log.debug(">> Found factoryId: %s", factoryId);
  Map<String, Object> cache = context.getApplicationMap();
  String key = ServiceFactory.class.getName() + '.' + factoryId;
  return getServiceFactory(cache, context, factoryId, key);
}
origin: org.graniteds/granite-server-ejb

Destination destination = ((ServicesConfig)context.getServicesConfig()).findDestinationById(
  request.getClass().getName(),
  destinationId
origin: org.graniteds/granite-server-cdi

  @Override
  public ServiceInvoker<?> getServiceInstance(RemotingMessage request) throws ServiceException {
    String messageType = request.getClass().getName();
    String destinationId = request.getDestination();

    ServicesConfig servicesConfig = GraniteContext.getCurrentInstance().getServicesConfig();
    Destination destination = servicesConfig.findDestinationById(messageType, destinationId);
    if (destination == null)
      throw new ServiceException("No matching destination: " + destinationId);
    
    if (!destination.getProperties().containsKey(TideServiceInvoker.VALIDATOR_CLASS_NAME))
      destination.getProperties().put(TideServiceInvoker.VALIDATOR_CLASS_NAME, "org.granite.tide.validation.BeanValidation");
    
    @SuppressWarnings("unchecked")
    Bean<PersistenceConfiguration> pcBean = (Bean<PersistenceConfiguration>)manager.getBeans(PersistenceConfiguration.class).iterator().next();
    PersistenceConfiguration persistenceConfiguration = (PersistenceConfiguration)manager.getReference(pcBean, PersistenceConfiguration.class, manager.createCreationalContext(pcBean));
    if (destination.getProperties().containsKey(ENTITY_MANAGER_FACTORY_JNDI_NAME))
      persistenceConfiguration.setEntityManagerFactoryJndiName(destination.getProperties().get(ENTITY_MANAGER_FACTORY_JNDI_NAME));
    else if (destination.getProperties().containsKey(ENTITY_MANAGER_JNDI_NAME))
      persistenceConfiguration.setEntityManagerJndiName(destination.getProperties().get(ENTITY_MANAGER_JNDI_NAME));
    
    // Create an instance of the component
    CDIServiceInvoker invoker = new CDIServiceInvoker(destination, this);
    return invoker;
  }
}
origin: org.ow2.kerneos.graniteds-osgi/granite-core

Destination destination = context.getServicesConfig().findDestinationById(messageType, destinationId);
if (destination == null)
  throw new ServiceException("No matching destination: " + destinationId);
origin: org.graniteds/granite-server

public ServiceAdapter getServiceAdapter(String messageType, String destinationId) throws ServiceException {
  GraniteContext context = GraniteContext.getCurrentInstance();
  log.debug(">> Finding serviceAdapter for messageType: %s and destinationId: %s", messageType, destinationId);
  ServicesConfig servicesConfig = context.getServicesConfig();
  Destination destination = servicesConfig.findDestinationById(messageType, destinationId);
  if (destination == null) {
    log.debug(">> No destination found: %s", destinationId);
    return null;
  }
  Adapter adapter = destination.getAdapter();
  String key = null;
  if (adapter != null) {
    log.debug(">> Found adapterRef: %s", adapter.getId());
    key = AdapterFactory.class.getName() + '@' + destination.getId() + '.' + adapter.getId();
  }
  else
    key = defaultAdapterClass.getName() + '@' + destination.getId();
  return getServiceAdapter(adaptersCache, context, destination, key, adapter != null ? adapter.getId() : null);
}
origin: org.graniteds/granite-server

Destination destination = ((ServicesConfig)context.getServicesConfig()).findDestinationById(
  message.getClass().getName(),
  message.getDestination()
origin: org.graniteds/granite-server

final Destination destination = ((ServicesConfig)context.getServicesConfig()).findDestinationById(
  message.getMessageRefType(),
  message.getDestination()
org.granite.config.flexServicesConfigfindDestinationById

Popular methods of ServicesConfig

  • findChannelById
  • findFactoryById
  • <init>
  • addChannel
  • addFactory
  • addService
  • findServiceById
  • forElement
  • handleClass
  • loadConfig
  • scan
  • scanConfig
  • scan,
  • scanConfig,
  • findServiceByDestination,
  • findServicesByMessageType,
  • removeChannel,
  • removeFactory,
  • removeService

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now