I don't know much about CAL ... could this kind of thing be accomplished by extending the ComponentClassEnhancementWorker chain of command? Or is CAL based on the raw Javassist APIs?
On 9/12/07, Tom Davies <[EMAIL PROTECTED]> wrote: > > > On 13/09/2007, at 12:00 AM, Howard Lewis Ship wrote: > > > I'd love to know why you want to do this ... it indicates to me > > that there > > needs to be some additional configuration available to CIS to > > support your > > needs. > > > > I don't know if I have a valid use-case, but what I'm doing is > experimenting with integrating Business Object's CAL language with > Java, so a page class from the tutorial app becomes: > > @Cal(workspace = "myworkspace.cws", module = "TDavies.Start") > public class Guess { > @Persist > private int _target; > > void setup(int target) > { > _target = target; > } > > public int getTarget() > { > return _target; > } > > private int _guess; > > public int getGuess() > { > return _guess; > } > > public void setGuess(int guess) > { > _guess = guess; > } > > @Persist > private String _message; > > public String getMessage() > { > return _message; > } > > String onActionFromLink(int guess) > { > _message = getNewMessage(guess, _target); > MaybeValue<String> nextPage = getNextPage(guess,_target); > return nextPage.getValueField(); > } > > @Cal > String getNewMessage(int guess, int target) > { > return null; > } > @Cal > MaybeValue<String> getNextPage(int guess, int target) > { > return null; > } > } > > Where the methods with the @Cal annotations are replaced by Javassist > with calls to CAL functions. I'm not even sure this is useful yet -- > I'm just exploring. > > To do this I needed to be able to apply a Javassist Translator to the > page classes as they were loaded (and javassist.Loader.addTranslator > should be named *setTranslator*!) > > Perhaps there is a better way? > > In any case, ComponentInstantiatorSourceImpl is quite monolithic -- > perhaps some of its components should be injected, e.g. a seperate > Translator, rather than having ComponentInstantiatorSourceImpl > implement Translator. > > Tom > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Partner and Senior Architect at Feature50 Creator Apache Tapestry and Apache HiveMind