Simples Assim

Improvement to Apache ActiveMQ 5.10

leave a comment »

The standard AMQP ports should be used instead.

https://issues.apache.org/jira/browse/AMQ-5451 (vote for it!)

About these ads

Written by Fernando Ribeiro

November 24, 2014 at 4:45 pm

Posted in Software

Tagged with

How to Create a Script Engine with the Java Scripting API

leave a comment »

SampleScriptEngineFactory.java

import java.util.ArrayList;
import java.util.List;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;

public final class SampleScriptEngineFactory implements ScriptEngineFactory {

  @Override
  public String getEngineName() {
    return null;
  }

  @Override
  public String getEngineVersion() {
    return null;
  }

  @Override
  public List<String> getExtensions() {
    return new ArrayList<String>();
  }

  @Override
  public String getLanguageName() {
    return null;
  }

  @Override
  public String getLanguageVersion() {
    return null;
  }

  @Override
  public String getMethodCallSyntax(final String obj, final String m, final String... args) {
    return null;
  }

  @Override
  public List<String> getMimeTypes() {
    return new ArrayList<String>();
  }

  @Override
  public List<String> getNames() {
    return new ArrayList<String>();
  }

  @Override
  public String getOutputStatement(final String toDisplay) {
    return null;
  }

  @Override
  public Object getParameter(final String key) {
    return null;
  }

  @Override
  public String getProgram(final String... statements) {
    return null;
  }

  @Override
  public ScriptEngine getScriptEngine() {
    return null;
  }

}

SampleScriptEngine.java

import java.io.Reader;

import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;

public class SampleScriptEngine implements ScriptEngine {

  @Override
  public Bindings createBindings() {
    return null;
  }

  @Override
  public Object eval(final Reader reader) {
    return null;
  }

  @Override
  public Object eval(final Reader reader, final Bindings n) {
    return null;
  }

  @Override
  public Object eval(final Reader reader, final ScriptContext context) {
    return null;
  }

  @Override
  public Object eval(final String script) {
    return null;
  }

  @Override
  public Object eval(final String script, final Bindings n) {
    return null;
  }

  @Override
  public Object eval(final String script, final ScriptContext context) {
    return null;
  }

  @Override
  public Object get(final String key) {
    return null;
  }

  @Override
  public Bindings getBindings(final int scope) {
    return null;
  }

  @Override
  public ScriptContext getContext() {
    return null;
  }

  @Override
  public ScriptEngineFactory getFactory() {
    return null;
  }

  @Override
  public void put(final String key, final Object value) {
  }

  @Override
  public void setBindings(final Bindings bindings, final int scope) {
  }

  @Override
  public void setContext(final ScriptContext context) {
  }

}

META-INF/services/javax.script.ScriptEngineFactory

SampleScriptEngineFactory

A sample is available here.

Written by Fernando Ribeiro

November 16, 2014 at 4:15 pm

Posted in Software

Tagged with , ,

How to Call a Script with the Java Scripting API

leave a comment »

import static java.lang.System.out;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public final class ScriptingSample {

  public static void main(final String[] args) throws Exception {
    final ScriptEngineManager manager = new ScriptEngineManager();

    final ScriptEngine engine = manager.getEngineByName("Sample");

    engine.put("x",  1); // same as engine.getBindings(ScriptContext.ENGINE_SCOPE).put("key", "value")

    out.println(engine.eval("x + 1")); // prints "2"
  }

}

Written by Fernando Ribeiro

November 16, 2014 at 10:50 am

Posted in Software

Tagged with , ,

How to List Script Engine Factories with the Java Scripting API

leave a comment »

import static java.lang.System.out;

import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;

public final class ScriptingSample {

  public static void main(final String[] args) {
    final ScriptEngineManager manager = new ScriptEngineManager();

    for (final ScriptEngineFactory factory : manager.getEngineFactories())

      for (final String name : factory.getNames())
        out.println(name);

  }

}

Written by Fernando Ribeiro

November 15, 2014 at 9:37 pm

Posted in Software

Tagged with , ,

Como Criar Seu Primeiro Programa em ArnoldC

leave a comment »

1) Instale o compilador.

2) Crie o arquivo HelloWorld.arnoldc:

IT'S SHOWTIME

TALK TO THE HAND "Simples Assim"

YOU HAVE BEEN TERMINATED

3) Compile o programa.

4) Execute o programa.

Written by Fernando Ribeiro

November 13, 2014 at 3:21 pm

Posted in Software

Tagged with ,

Bug in Tomcat 8.0.12

with one comment

There are several fixes to make in the documentation of the JDBC-based store.

https://issues.apache.org/bugzilla/show_bug.cgi?id=57147 (vote for it!)

Written by Fernando Ribeiro

October 26, 2014 at 6:32 pm

Posted in Software

Tagged with

Improvement to Infinispan 6.0.2

leave a comment »

Tomcat should be supported.

https://issues.jboss.org/browse/ISPN-465 (vote for it!)

Written by Fernando Ribeiro

October 12, 2014 at 1:48 am

Posted in Software

Tagged with , ,

Follow

Get every new post delivered to your Inbox.

Join 1,232 other followers