Tabnine Logo
Destination
Code IndexAdd Tabnine to your IDE (free)

How to use
Destination
in
org.granite.config.flex

Best Java code snippets using org.granite.config.flex.Destination (Showing top 20 results out of 315)

origin: org.graniteds/granite-server

  @Override
  protected Destination buildDestination(Adapter adapter) {
    Destination destination = super.buildDestination(adapter);
    destination.getProperties().put("server", null);
    destination.getProperties().put("server/broker-url", brokerUrl);
    destination.getProperties().put("server/create-broker", String.valueOf(createBroker));
    if (createBroker) {
      destination.getProperties().put("server/wait-for-start", String.valueOf(waitForStart));
      destination.getProperties().put("server/durable", String.valueOf(durable));
      if (durable)
        destination.getProperties().put("server/file-store-root", fileStoreRoot);
    }
    return destination;
  }
}
origin: org.graniteds/granite-server-ejb

public EjbServiceInvoker(Destination destination, EjbServiceFactory factory) throws ServiceException {
  super(destination, factory);
  String lookup = factory.getLookup();
  if (destination.getProperties().containsKey("lookup"))
    lookup = destination.getProperties().get("lookup");
  // Compute EJB JNDI binding.
  String name = destination.getId();
  if (lookup != null) {
    name = lookup;
    if (lookup.contains(CAPITALIZED_DESTINATION_ID))
      name = lookup.replace(CAPITALIZED_DESTINATION_ID, capitalize(destination.getId()));
    if (lookup.contains(DESTINATION_ID))
      name = lookup.replace(DESTINATION_ID, destination.getId());
  }
  log.debug(">> New EjbServiceInvoker looking up: %s", name);
  try {
    invokee = factory.lookup(name);
  } catch (NamingException e) {
    throw new ServiceException("Could not lookup for: " + name, e);
  }
  
  this.metadata = destination.getScannedClass() != null ?
    new EjbServiceMetadata(destination.getScannedClass(), invokee.getClass()) :
    new EjbServiceMetadata(destination.getProperties(), invokee.getClass());
}
origin: org.graniteds/granite-server

  protected Destination buildDestination(Adapter adapter) {
    List<String> channelIds = new ArrayList<String>();
    channelIds.add("gravityamf");
    Destination destination = new Destination(id, channelIds, new XMap(), roles, adapter, null);
    destination.getProperties().put("no-local", String.valueOf(noLocal));
    destination.getProperties().put("session-selector", String.valueOf(sessionSelector));
    if (getSecurizerClassName() != null)
      destination.getProperties().put("securizer", securizerClassName);
    if (getSecurizer() != null)
      destination.setSecurizer(getSecurizer());
    return destination;
  }
}
origin: org.graniteds/granite-server

  protected Destination buildDestination() {
    List<String> channelIds = new ArrayList<String>();
    channelIds.add("graniteamf");
    Destination destination = new Destination(source, channelIds, new XMap(), roles, null, null);
    if (securizer != null)
      destination.setSecurizer(securizer);
    return destination;
  }
}
origin: org.ow2.kerneos.graniteds-osgi/granite-core

String key = OSGiServiceFactory.class.getName() + '.' + destination.getId();
  String factoryId = destination.getProperties().get("factory");
  if (factoryId == null) {
    GraniteDestination gd;
    synchronized (destinationServices) {
      gd = destinationServices.get(destination.getId());
      throw new ServiceException("Could not get OSGi destination: " + destination.getId());
    obj = gd;
  } else {
origin: org.graniteds/granite-client

protected SimpleServiceInvoker(Destination destination, SimpleServiceFactory factory) throws ServiceException {
  super(destination, factory);
  String className = destination.getProperties().get("source");
  if (className == null)
    throw new ServiceException("No source property for destination: " + destination);
  className = className.trim();
  log.debug(">> New SimpleServiceInvoker constructing new: %s", className);
  // Invokee class set at runtime (RemoteObject.source).
  if ("*".equals(className))
    sources = new HashMap<String, Object>();
  else {
    try {
      if (destination.getScannedClass() != null)
        this.invokee = destination.getScannedClass().newInstance();
      else
        this.invokee = TypeUtil.newInstance(className);
    } catch (Exception e) {
      throw new ServiceException("Invalid source property for destination: " + destination, e);
    }
    sources = null;
  }
}
origin: org.graniteds/granite-server

channelIds.add("graniteamf");
List<String> tideRoles = serverFilter.tideRoles().length == 0 ? null : Arrays.asList(serverFilter.tideRoles());
Destination destination = new Destination(type, channelIds, new XMap(), tideRoles, null, null);
destination.getProperties().put("factory", "tide-" + type + "-factory");
if (!("".equals(serverFilter.entityManagerFactoryJndiName())))
  destination.getProperties().put("entity-manager-factory-jndi-name", serverFilter.entityManagerFactoryJndiName());
else if (!("".equals(serverFilter.entityManagerJndiName())))
  destination.getProperties().put("entity-manager-jndi-name", serverFilter.entityManagerJndiName());
if (!("".equals(serverFilter.validatorClassName())))
  destination.getProperties().put("validator-class-name", serverFilter.validatorClassName());
service.getDestinations().put(type, destination);
if (destination.getSecurizer() == null && configProvider != null) {
  RemotingDestinationSecurizer securizer = configProvider.findInstance(RemotingDestinationSecurizer.class);
  destination.setSecurizer(securizer);
origin: org.graniteds/granite-server

public void destinationRemoved(Destination destination) throws ServiceException {
  synchronized (invalidKeys) {
    invalidKeys.add(SimpleServiceInvoker.class.getName() + '.' + destination.getId());
  }
}
 
origin: org.graniteds/granite-server

  public static Service forElement(XMap element) {
    String id = element.get("@id");
    String className = element.get("@class");
    String messageTypes = element.get("@messageTypes");

    Adapter defaultAdapter = null;
    Map<String, Adapter> adaptersMap = new HashMap<String, Adapter>();
    for (XMap adapter : element.getAll("adapters/adapter-definition")) {
      Adapter ad = Adapter.forElement(adapter);
      if (Boolean.TRUE.toString().equals(adapter.get("@default")))
        defaultAdapter = ad;
      adaptersMap.put(ad.getId(), ad);
    }

    Map<String, Destination> destinations = new HashMap<String, Destination>();
    for (XMap destinationElt : element.getAll("destination")) {
      Destination destination = Destination.forElement(destinationElt, defaultAdapter, adaptersMap);
      destinations.put(destination.getId(), destination);
    }

    return new Service(id, className, messageTypes, defaultAdapter, adaptersMap, destinations);
  }
}
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-server

Destination dest=service.getDestinations().remove(anno.id());
if (dest != null) {
  dest.remove();
  log.info("RemoteDestination:"+dest.getId()+" has been removed");
origin: org.graniteds/granite-server

  props.put("securizer", anno.securizer().getName());
Destination destination = new Destination(anno.id(), channelIds, props, roles, null, clazz);
service.getDestinations().put(destination.getId(), destination);
origin: org.graniteds/granite-server

log.debug(">> No cached factory for: %s", adapterId);
Adapter config = destination.getAdapter();
try {
  Class<? extends ServiceAdapter> clazz = (adapterId != null)
  serviceAdapter.setId(adapterId);
  serviceAdapter.setGravity(gravity);
  serviceAdapter.configure(config.getProperties(), destination.getProperties());
  serviceAdapter.start();
log.debug(">> Found a cached serviceAdapter for ref: %s", destination.getAdapter());
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

if (destination.getSecurizer() instanceof GravityDestinationSecurizer) {
  try {
    ((GravityDestinationSecurizer)destination.getSecurizer()).canPublish(invocationContext);
origin: org.graniteds/granite-client

  public static Destination forElement(XMap element, Adapter defaultAdapter, Map<String, Adapter> adaptersMap) {
    String id = element.get("@id");

    List<String> channelRefs = new ArrayList<String>();
    for (XMap channel : element.getAll("channels/channel[@ref]"))
      channelRefs.add(channel.get("@ref"));

    XMap properties = new XMap(element.getOne("properties"));

    List<String> rolesList = null;
    if (element.containsKey("security/security-constraint/roles/role")) {
      rolesList = new ArrayList<String>();
      for (XMap role : element.getAll("security/security-constraint/roles/role"))
        rolesList.add(role.get("."));
    }

    XMap adapter = element.getOne("adapter[@ref]");
    Adapter adapterRef = adapter != null && adaptersMap != null
      ? adaptersMap.get(adapter.get("@ref"))
      : defaultAdapter;

    return new Destination(id, channelRefs, properties, rolesList, adapterRef, null);
  }
}
origin: org.graniteds/granite-server

if (Boolean.TRUE.toString().equals(destination.getProperties().get("session-selector"))) {
  String selector = gdd.getDestinationSelector(destination.getId());
  log.debug("Session selector found: %s", selector);
  if (selector != null)
origin: org.graniteds/granite-server

protected SimpleServiceInvoker(Destination destination, SimpleServiceFactory factory) throws ServiceException {
  super(destination, factory);
  String className = destination.getProperties().get("source");
  if (className == null)
    throw new ServiceException("No source property for destination: " + destination);
  className = className.trim();
  log.debug(">> New SimpleServiceInvoker constructing new: %s", className);
  // Invokee class set at runtime (RemoteObject.source).
  if ("*".equals(className))
    sources = new HashMap<String, Object>();
  else {
    try {
      if (destination.getScannedClass() != null)
        this.invokee = destination.getScannedClass().newInstance();
      else
        this.invokee = TypeUtil.newInstance(className);
    } catch (Exception e) {
      throw new ServiceException("Invalid source property for destination: " + destination, e);
    }
    sources = null;
  }
}
origin: org.graniteds/granite-client

public void destinationRemoved(Destination destination) throws ServiceException {
  synchronized (invalidKeys) {
    invalidKeys.add(SimpleServiceInvoker.class.getName() + '.' + destination.getId());
  }
}
 
origin: org.graniteds/granite-client

  public static Service forElement(XMap element) {
    String id = element.get("@id");
    String className = element.get("@class");
    String messageTypes = element.get("@messageTypes");

    Adapter defaultAdapter = null;
    Map<String, Adapter> adaptersMap = new HashMap<String, Adapter>();
    for (XMap adapter : element.getAll("adapters/adapter-definition")) {
      Adapter ad = Adapter.forElement(adapter);
      if (Boolean.TRUE.toString().equals(adapter.get("@default")))
        defaultAdapter = ad;
      adaptersMap.put(ad.getId(), ad);
    }

    Map<String, Destination> destinations = new HashMap<String, Destination>();
    for (XMap destinationElt : element.getAll("destination")) {
      Destination destination = Destination.forElement(destinationElt, defaultAdapter, adaptersMap);
      destinations.put(destination.getId(), destination);
    }

    return new Service(id, className, messageTypes, defaultAdapter, adaptersMap, destinations);
  }
}
org.granite.config.flexDestination

Most used methods

  • getProperties
  • getId
  • getScannedClass
  • <init>
  • addRemoveListener
  • forElement
  • getSecurizer
  • remove
  • getAdapter
  • getRoles
  • isSecured
  • setSecurizer
  • isSecured,
  • setSecurizer

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JOptionPane (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top Sublime Text 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