synchronized (this)
{
if (sharedTldMetaData == null && tldJars != null)
{
UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
Unmarshaller unmarshaller = factory.newUnmarshaller();
SchemaBindingResolver resolver = SingletonSchemaResolverFactory
.getInstance().getSchemaBindingResolver();
// Parse shared JARs for TLDs
sharedTldMetaData = new ArrayList<TldMetaData>();
if (tldJars != null)
{
VirtualFileFilter tldFilter = new SuffixMatchFilter(".tld", VisitorAttributes.DEFAULT);
for (URL tldJar : tldJars)
{
try
{
VirtualFile virtualFile = VFS.getChild(tldJar);
VirtualFile metaInf = virtualFile.getChild("META-INF");
if (metaInf != null)
{
List<VirtualFile> tlds = metaInf.getChildren(tldFilter);
for (VirtualFile tld : tlds)
{
TldMetaData tldMetaData = (TldMetaData) unmarshaller.unmarshal(tld.toURL().toString(), resolver);
sharedTldMetaData.add(tldMetaData);
}
}
}
catch (Exception e)