Custom JMI implementation
Hi,
I've been reading the document on how to customize JMI implementation.
I ran the example of the ModelElement class but I'm not sure that this
will solve my initial problem.
I designed an UML metamodel in ArgoUML and then transformed it to MOF
metamodel. My resulting mof package is called ProjectPackage. I want to
add some contraint checkings to this package whenever i call the
refVerifyConstraints(boolean) method, for example, checking that every
class in my mof package has an atribute called "name".
My ProjectPackage generated jmi class is in the package
org.netbeans.jmi.project
This is how i tried to implement it, so that i can check contraints,
according to what i read in the document:
package org.netbeans.jmiimpl.project;
import org.netbeans.mdr.handlers.*;
import org.netbeans.jmi.project.*;
import org.netbeans.mdr.storagemodel.*;
import java.util.Collection;
public abstract class ProjectPackageImpl extends InstanceHandler
implements
ProjectPackage {
protected ProjectPackageImpl(StorableObject storable) {
super(storable);
}
protected Collection _verify(Collection verify) {
super._verify(verify);
// do your stuff here
return verify;
}
}
The thing is, when i obtain the package instance:
ProjectPackage project =
(ProjectPackage)repository.getExtent("project");
Where the "project" extent is where i loaded my mof metamodel, it
brings me the autogenerated JMI implementation, and never references my
class (i now this because i debugged it with some breakpoints).
Is what i am trying to do possible? Is the way i am trying to do it
wrong?
Thanks,
Viviana
---------------------------------------------------------------------------------------------------------------------------------------
La información contenida en este mensaje es para uso exclusivo del destinatario y demás autorizados a recibirla. Si usted ha recibido este e-mail por error, comuníquelo inmediatamente por esta vía y elimínelo de su sistema. Si Ud. no es el destinatario especificado en el mensaje, cualquier revelación, copia o distribución de su contenido está estrictamente prohibido.
El mensaje expresa la opinión de su autor pero no necesariamente expresa la opinión oficial del Banco Central del Uruguay.
The information included on this message is intended only for the personal and confidential use of the designated recipient(s) named above. If you have received it by mistake please let us know by e-mail immediately and destroy or delete it from your files or system. If you are not the designated recipient, any disclose, copy or distribution of its contents is prohibited.
<<>>