Re: [jexl]

2011-02-18 Thread henrib

Hello Karl,

Yes, JEXL (version 2 at least) is still being supported; I'm planning a
release 2.0.2 soon.
I dont know - could not figure out - which projects actually do use JEXL 2.0
(if any).
I do know that it is in use in a couple of deployed professional software.
There aren't any known leaks (none that I'm aware of); caches are
soft-refed, can be explicitly purged and even the class loader used for
dynamic creation can be re-assigned.

About parsing at startup, the JEXL engine instantiates expressions (see
http://commons.apache.org/jexl/apidocs/org/apache/commons/jexl2/package-summary.html#package_description
); you can very easily create/parse all your expressions before usage as you
describe.

Regards,
Henrib
-- 
View this message in context: 
http://apache-commons.680414.n4.nabble.com/jexl-tp3312960p3313227.html
Sent from the Commons - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[daemon]

2011-02-18 Thread Matthias Altmann
Hi @all,

I'm trying to run a daemon for JXTA, a Java Framework for P2P
networks. Here I used the Java Implementation with the following code
integrating JSVC:

package privatenet;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import java.net.URI;
import java.net.URISyntaxException;

import java.util.Properties;

import net.jxta.discovery.DiscoveryService;

import net.jxta.document.MimeMediaType;
import net.jxta.document.StructuredDocumentFactory;
import net.jxta.document.XMLElement;

import net.jxta.exception.PeerGroupException;

import net.jxta.id.IDFactory;

import net.jxta.peergroup.NetPeerGroupFactory;
import net.jxta.peergroup.PeerGroup;
import net.jxta.peergroup.PeerGroupID;

import net.jxta.platform.ModuleSpecID;
import net.jxta.platform.NetworkConfigurator;

import net.jxta.protocol.ConfigParams;
import net.jxta.protocol.ModuleImplAdvertisement;
import net.jxta.protocol.PeerGroupAdvertisement;

import net.jxta.rendezvous.RendezvousEvent;
import net.jxta.rendezvous.RendezVousService;
import net.jxta.rendezvous.RendezvousListener;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import org.apache.commons.daemon.Daemon;
import org.apache.commons.daemon.DaemonContext;


public class Rendezvous implements RendezvousListener,Daemon {
   RendezVousService netpgRendezvous;
   RendezVousService apppgRendezvous;
   private staticLogger   logger;
   private   String   jxtaHome;
   private   PeerGroupnetPeerGroup;
   private   PeerGroupnewGroup;
   private   DiscoveryService discovery;
   private   NetworkConfigurator  configurator;

   // our chosen peer ID
   private   String   peerID =
"urn:jxta:uuid-79B6A084D3264DF8B641867D926C48D9F8BA10F44BA74475ABE2BB568892B0DC03";

   // parameters that define our private JXTA NetPeerGroup
   String NetPeerGroupID="urn:jxta:uuid-8B33E028B054497B8BF9A446A224B1FF02";
   String NetPeerGroupName="My NetPG";
   String NetPeerGroupDesc="A Private Net Peer Group";

   // 
-

public void initRdv() {
  jxtaHome = System.getProperty("JXTA_HOME");
  if( null == jxtaHome ) {
 logger.info("JXTA_HOME null.  Exiting.");
 System.out.println("JXTA_HOME null.  Exiting.");
 System.exit(1);
  }
  logger = initLogger();

  clearCache(new File(jxtaHome,"cm"));
  logger.info("Private " + this.getClass().getName() + " Starting");
   }

   // 


   /**
* Load everything that is basically needed to start the Rendezvous.
* Open configuration files, init the logger, create the
ServerSockets, the Threads, etc ...
*
* @see 
org.apache.commons.daemon.Daemon#init(org.apache.commons.daemon.DaemonContext)
*/
public void init(DaemonContext dc) throws Exception {

// initialize the RDV
this.initRdv();

// configure JXTA
this.configurator = this.configureJXTA();

}

   public  void start() throws Exception {
  try {
 startJXTA();
 createPeerGroup();
 waitForQuit();
  }
  catch (PeerGroupException e) {
 e.printStackTrace();
 logger.warn("Exiting.");
 System.exit(0);
  }
  catch (Exception e) {
 logger.warn("Unable to start JXTA platform.  Exiting.");
 e.printStackTrace();
 System.exit(0);
  }
   }

/**
 * Stop the  Rendezvous/Relay.
 *
 * @see org.apache.commons.daemon.Daemon#stop()
 */
public void stop() throws Exception {

   logger.info("Stop Rdv ...");

   // stop JXTA
   this.stopJXTA();

}

/**
 * Destroy any object created in init().
 *
 * @see org.apache.commons.daemon.Daemon#destroy()
 */
public void destroy() {

logger.info("Destroy Rdv ...");

// only reset the logger
logger = null;

}

   // 
-

   private void startJXTA() throws PeerGroupException, Exception {
  logger.info("Starting JXTA platform");

  NetPeerGroupFactory factory;
  try {
 factory = new NetPeerGroupFactory(
(ConfigParams)configurator.getPlatformConfig(),
new File(jxtaHome).toURI(),
IDFactory.fromURI(new URI(NetPeerGroupID)),
NetPeerGroupName,
(XMLElement)
StructuredDocumentFactory.newStructuredDocument(MimeMediaType.XMLUTF8,
"desc", NetPeerGroupName)
 );
  }
  catch(URISyntaxException e) {
 throw new Exception(e.getMessage());
  }

  netPeerGroup = factory.getInterface();

  // The rendezvous service for NetPeerGroup
  netpgRendezvous = netPee

Re: [jci] Can someone please make a 1.1 release?

2011-02-18 Thread Joe Littlejohn
> It sounds like it a week of someone's time to wake up [jci], fix the tests, 
> update the build, etc.
>
> Even if the above is done by a non-committer, a committer needs to take the 
> time cut at least one RC and the release, which is still a non-trivial 
> process.

Perhaps an alternative (less work) would be to add an up-to-date
1.1-SNAPSHOT to http://repository.apache.org/snapshots/ ?

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Configuration] Is there any way to save my complex bean in XML resource and use it later ?

2011-02-18 Thread Mike Power



On 02/16/2011 02:32 AM, Jörg Schaible wrote:

Hi Moein,

Moein Enayati wrote:


Dear all
Hi


Till now ,whenever I want to use Apache.Commons.Configuration API with an
XML file , I’ve written down myBeans definition manually in XML resource.

But now I have a new demand to use complex beans with complex property
types and the ability to save them (their signature) automatically in the
XML resource.


I’ve just find apache.commons.betwixt. BeanWriter() having the ability ,
but it seems configuration-API has its own signature.


Is there any way in Apache.commons.configuration  to save my beans in an
xml file which is compatible with configuration ?

This is definitely out of scope for commons configuration. What you're
looking for is a persistence layer that can turn a Java object into XML and
restore it later. This is a classical task for JAXB or something like
XStream.

- Jörg
Just sharing an observation I have made while researching my 
configuration needs.  I ended up looking in commons configuration for a 
means of loading a configuration from XML into a Configuration object 
and then loading from that Configuration into a bean.  I still wanted 
interpolation and combined configuration.  I did not find that in 
Configuration so I decided that I would still use Configuration and not 
design and implement that particular solution.


My use case, I am writing an application, maven plugin, ant plugin, all 
of which basically does the same thing.  Both ant and maven have a a 
configuration api that represents a bean as XML.  So that covered both 
ant and maven, but I still needed a way to configure the application.  I 
thought it would be nice to leverage the same concept that I used for 
maven and ant.  The idea being that maven, ant, and the application 
would load their configuration into the same bean object.  The XML 
between the three may not be syntactically the same, but it would be 
familiar.


I find the configuration api to be useful as it is, and I am perfectly 
happy adding an additional library for functionality when it is out of 
scope for configuration.


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[jexl]

2011-02-18 Thread Vanneste, Karl
Hello,
We are replacing JEL with JEXL in an upcoming release.  JEL was a similar Java 
Expression Language tool.  We are replacing it with JEXL because we experienced 
memory leaks in JEL, and it looks like JEL is no longer being supported.

Is JEXL still being supported?

Have you seen equivalent memory leaks?

What is the JEXL user base like?

When I start up my app, I want to parse my set of expressions to see if they 
will work properly.  There were several notes about the "parser" class - that 
maybe we should not use it.  I would like to use it like this - is this ok?

Parser parser = new Parser(new StringReader(";"));
try {
parser.parse(new StringReader(expression), null);
}
catch (ParseException e) {
LogWriter.logMessageToFile("compileJelRule: ParseException emerged 
from Jexl compiled code\nSee " + e.getMessage());
buildParserErrorMessage(baseRule, expression,  e.getMessage());
result = Boolean.FALSE;
}


Thank you,

Karl Van Neste

Software Team Lead
The College Board
11955 Democracy Drive, 14-1058
Reston, VA  20190-5662

571-485-3433 (Office)
571-643-6922 (Cell)
kvanne...@collegeboard.org

Connect to college success
Inspiring Minds