E
epicwinter
I am working on a large application that requires access to secure
data. When the user or permissions are changed i would like to
automatically update all these classes without having to reload them
manually. The approach I am trying to take is by having them all
implement an interface:
public interface SecurityIF
{
public void securityChanged();
}
In this manner they can individual handle the security updates they
need to independantly of eachother . My problem is how to invoke this.
Originally I was only implementing this interface within swing classes
and so I was able to extract all the swing components within my frame
recursively and if then check if they implemented this method and
execute it if so:
public updateSecurity()
{
Component[] compenents = extractAllComponents();
for (int i = 0; i < compenents i++)
{
Component component = (Component)
componentVector.get(i);
if (component != null & component
instanceof SecurityIF
{
SecurityIF
component).securityChanged();();
}
}
}
Now I would like to expand this outside my swing classes to services
and such.
Is there a way to do get all the classes loaded that implement this
interface and then execute the securityChanged() method on them?
thx
data. When the user or permissions are changed i would like to
automatically update all these classes without having to reload them
manually. The approach I am trying to take is by having them all
implement an interface:
public interface SecurityIF
{
public void securityChanged();
}
In this manner they can individual handle the security updates they
need to independantly of eachother . My problem is how to invoke this.
Originally I was only implementing this interface within swing classes
and so I was able to extract all the swing components within my frame
recursively and if then check if they implemented this method and
execute it if so:
public updateSecurity()
{
Component[] compenents = extractAllComponents();
for (int i = 0; i < compenents i++)
{
Component component = (Component)
componentVector.get(i);
if (component != null & component
instanceof SecurityIF
{
SecurityIF
component).securityChanged();();
}
}
}
Now I would like to expand this outside my swing classes to services
and such.
Is there a way to do get all the classes loaded that implement this
interface and then execute the securityChanged() method on them?
thx