tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 蓝天白云 <donf.y...@gmail.com>
Subject Re: Problems with developing Tapestry 5 on osgi environment
Date Tue, 05 May 2009 01:59:59 GMT
ComponentLocator is used to find a class corresponding to some
page/component/mixin.
public interface ComponentLocator {
 public static final int LOCATE_PAGE = 1;
 public static final int LOCATE_COMPONENT = 2;
 public static final int LOCATE_MIXIN = 3;
 /**
  * Locate a class by logic name and locate type
  */
 public String locate(String logicName, int locateType);
 public boolean isClassExists(String className);
}

When tapestry handling a http request to "/start" on the first time,
TapestryComponentClassResolver.resolvePageNameToClassName() will try
to locate the class of logic name "com.foo.pages.start", and mapping the
classname to logic name if found, then any request to "/start" in further
will be done in tapestry's way.

so, the problem is, how I locate a class by the case-insensitive logic name
? (if the request path is "/thisiSmyPage", truely this is fine in
traditional way)


2009/5/5 Thiago H. de Paula Figueiredo <thiagohp@gmail.com>

> Em Mon, 04 May 2009 14:09:27 -0300, 蓝天白云 <donf.yang@gmail.com> escreveu:
>
> Hi,
>>
>
> Hi!
>
> I'm developing Tapestry 5 base on osgi environment recently
>>
>
> Nice! Could you share the code with use when it's done?
>
> and it's almost done at this time but 3 problems:
>>
> [snip]
>
>> *1. case-insensitive*
>>
>> As we know, java is a case-sensitive world,, I really can't make sense why
>> tapestry built with case-insensitive.
>>
>
> I'm not familiar with OSGi, but what's the problem here?
>
> *2. controlledPackageNames*
>>
>> I can't remove packages from controlledPackageNames when component bundles
>> stop until get any supported method from ComponentInstantiatorSource such
>> like
>>
>>  void removePackage(String packageName);
>>
>
> Components (and pages and mixins) are added through Tapestry IoC, which
> loads all modules at registry startup time. After that, you can't add nor
> remove modules (including components, pages and mixins).
>
> *3. Service binding*
>>  This is a major problem with osgi.
>> I just researched how tapestry's service binding, if any chance to provide
>> a way to add modules in Registry or something else like following:
>>
>> addModules(Collection<ModuleDef> moduleDefs, ...)
>>
>
> You cannot add modules after the Registry is created, but you can add them
> before, using RegistryBuilder directly. Or, in the case of the
> TapestryFilter, using TapestryAppInitializer. Reading your code, I've found
> this line in
> http://extwind.googlecode.com/svn/trunk/Tapestry-OSGi/org.extwind.osgi.tapestry/src/org/extwind/osgi/tapestry/internal/proxy/ProxyTapestryFilter.java
> :
>
> TapestryAppInitializer appInitializer = new
> TapestryAppInitializer(provider, filterName, "servlet");
>
> After this line, you can call appInitializer.addModules(Class... modules)
> to add any Tapestry-IoC module you need.
>
> I hope I gave you some good hints. :)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 

Regards,

Donf Yang
------------------------------------------------------------------------------
To be surprised,to wonder,is to begin to understand.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message