Bean Session supports a specific subset of beans as defined in the Java Bean specification.

A Java Bean is a re-usable software component defined as

  • Having a no-argument constructor
  • Having access to properties via setters and getters
  • Being java serializable
  • Supporting events generated by other beans

The bean session allows the alternative of serializing to and from RDF. In this case, mappings are made between bean properties and predicates. See the note below on events.

Supported property types

Here is a list of all types supported as properties. These may be single-valued, one-dimensional arrays, collections or maps. Maps and collection are required to be parameterized, but there is no restriction outside of this list.

  • boolean, Boolean
  • java.util.Date
  • double, Double
  • int, Integer
  • java.io.File (not the content)
  • float, Float
  • long, Long
  • Triple
  • Resource
  • UriRef
  • java.net.URL
  • java.net.URI

Any bean that satisfies this list is also permitted. Here is a complete example of such a bean

public class Person{
   String name;
   public String getName(){return name;}
   public void setName(String name){this.name = name;}
 
   Collection<Person> friends;
   public Collection<Person> getFriends(){return friends;}
   public void setFriends(Collection<Person> friends){this.friends = friends;}
}

This models a FOAF person.

Particulars and many examples will be found in the tutorial.

Events are not supported.

The Bean Session does not track events. The reasons for this are two-fold. First, events are chiefly used for allowing user-driven interfaces to operate. This state is transitory and it would a rare situation where preserving it would be needed. More practically, there is no standard way to discover what listeners have been added to a bean. Hence there is no way to reconstruct a list of listeners. This is a limitation of the bean specification itself.

  • No labels