Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] ComponentCore.createComponent(IProject)


Thanks Ted,

Sorry for not replying earlier...  

This is not the only place where we need a policy across our api for handling workspace state.
Validation/builders is another area where the project metadata might not be fully initialized because of startup, or load timing issues.

In this case, perhaps a specific exception type should be created warning callers of a bad project state.  This type of change is more appropriate in 2.x timeframe

-Chuck

Rational J2EE Tooling Team Lead
IBM Software Lab - Research Triangle Park, NC
Email:  cbridgha@xxxxxxxxxx
Phone: 919-254-1848 (T/L: 444)



"Ted Bashor" <tbashor@xxxxxxx>
Sent by: wtp-dev-bounces@xxxxxxxxxxx

11/13/2006 03:03 PM

Please respond to
"General discussion of project-wide or architectural issues."        <wtp-dev@xxxxxxxxxxx>

To
"General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>
cc
Subject
[wtp-dev] ComponentCore.createComponent(IProject)





My understanding is that during project import (and possibly during startup), some project resources may not be available even though they exist on the machine’s file system.
 
We suspect that this may be causing an early call to
ComponentCore.createComponent()
which calls into
ComponentImplManager.createComponent()
 
      public IVirtualComponent createComponent(IProject project) {
            try {
                  IComponentImplFactory factory = findFactoryForProject(project);
                  if(null != factory){
                        return factory.createComponent(project);
                  }
            } catch (Exception e) {
                  // Just return a default component
            }
            if (!ModuleCoreNature.isFlexibleProject(project)){
                  return null;
            }
            return new VirtualComponent(project, new Path("/")); //$NON-NLS-1$
      }
 
to swallow a null factory or exception and return a “default VirtualComponent”, for which any web project WebContent directory mappings will be invalid, etc.
 
My question is, what would be a preferred way to detect this situation?
 
Calling IVirtualComponent.exists() doesn’t seem to be what we want, since it just checks that the project exists and has the module core nature.  I’d hate to wrap my call to ComponentCore.createComponent() with a check for whether either “.settings/org.eclipse.wst.common.component” or “.settings/.component” (and deployment descriptors?) are synchronized, but is there no other way?
 
Seems like createComponent (or a variant) should be returning null or propagating the exception, but I assume this isn’t an option for 1.5.x…
 
Thanks, Ted

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev


Back to the top