* @exception NameDuplicationException If the container already has
* a port with the name of this port.
*/
public void setContainer(Entity container) throws IllegalActionException,
NameDuplicationException {
NamedObj oldContainer = getContainer();
if (container == oldContainer) {
// Nothing to do.
return;
}
boolean disableStatus = _mirrorDisable;
try {
_workspace.getWriteAccess();
if (_mirrorDisable || (getContainer() == null)) {
// Have already called the super class.
// This time, process the request.
super.setContainer(container);
} else {
_mirrorDisable = true;
boolean success = false;
if (oldContainer != null) {
Nameable modal = oldContainer.getContainer();
if (modal instanceof MultiCompositeActor) {
Port port = ((MultiCompositeActor) modal)
.getPort(getName());