Package org.jboss.iiop.rmi.ir

Source Code of org.jboss.iiop.rmi.ir.OperationDefImpl

/*     */ package org.jboss.iiop.rmi.ir;
/*     */
/*     */ import org.omg.CORBA.Any;
/*     */ import org.omg.CORBA.BAD_INV_ORDER;
/*     */ import org.omg.CORBA.ContainedOperations;
/*     */ import org.omg.CORBA.ContainedPackage.Description;
/*     */ import org.omg.CORBA.DefinitionKind;
/*     */ import org.omg.CORBA.ExceptionDef;
/*     */ import org.omg.CORBA.ExceptionDescription;
/*     */ import org.omg.CORBA.ExceptionDescriptionHelper;
/*     */ import org.omg.CORBA.IDLType;
/*     */ import org.omg.CORBA.IDLTypeHelper;
/*     */ import org.omg.CORBA.IRObject;
/*     */ import org.omg.CORBA.ORB;
/*     */ import org.omg.CORBA.OperationDef;
/*     */ import org.omg.CORBA.OperationDefHelper;
/*     */ import org.omg.CORBA.OperationDefOperations;
/*     */ import org.omg.CORBA.OperationDefPOATie;
/*     */ import org.omg.CORBA.OperationDescription;
/*     */ import org.omg.CORBA.OperationDescriptionHelper;
/*     */ import org.omg.CORBA.OperationMode;
/*     */ import org.omg.CORBA.ParameterDescription;
/*     */ import org.omg.CORBA.TypeCode;
/*     */
/*     */ class OperationDefImpl extends ContainedImpl
/*     */   implements OperationDefOperations
/*     */ {
/* 205 */   private OperationDef ref = null;
/*     */   private TypeCode typeCode;
/*     */   private LocalIDLType type_def;
/*     */   private ParameterDescription[] params;
/*     */   private ExceptionDef[] exceptions;
/*     */
/*     */   OperationDefImpl(String id, String name, String version, LocalContainer defined_in, TypeCode typeCode, ParameterDescription[] params, ExceptionDef[] exceptions, RepositoryImpl repository)
/*     */   {
/*  69 */     super(id, name, version, defined_in, DefinitionKind.dk_Operation, repository);
/*     */
/*  72 */     this.typeCode = typeCode;
/*  73 */     this.params = params;
/*  74 */     this.exceptions = exceptions;
/*     */   }
/*     */
/*     */   public IRObject getReference()
/*     */   {
/*  84 */     if (this.ref == null) {
/*  85 */       this.ref = OperationDefHelper.narrow(servantToReference(new OperationDefPOATie(this)));
/*     */     }
/*     */
/*  88 */     return this.ref;
/*     */   }
/*     */
/*     */   public void allDone()
/*     */     throws IRConstructionException
/*     */   {
/*  95 */     this.type_def = IDLTypeImpl.getIDLType(this.typeCode, this.repository);
/*     */
/*  98 */     for (int i = 0; i < this.params.length; i++) {
/*  99 */       LocalIDLType lit = IDLTypeImpl.getIDLType(this.params[i].type, this.repository);
/* 100 */       if (lit == null)
/* 101 */         throw new RuntimeException("???????????1?");
/* 102 */       this.params[i].type_def = IDLTypeHelper.narrow(lit.getReference());
/* 103 */       if (this.params[i].type_def == null) {
/* 104 */         throw new RuntimeException("???????????2?");
/*     */       }
/*     */     }
/* 107 */     getReference();
/*     */   }
/*     */
/*     */   public TypeCode result()
/*     */   {
/* 115 */     return this.typeCode;
/*     */   }
/*     */
/*     */   public IDLType result_def()
/*     */   {
/* 120 */     return IDLTypeHelper.narrow(this.type_def.getReference());
/*     */   }
/*     */
/*     */   public void result_def(IDLType arg)
/*     */   {
/* 125 */     throw new BAD_INV_ORDER("Cannot change RMI/IIOP mapping.");
/*     */   }
/*     */
/*     */   public ParameterDescription[] params()
/*     */   {
/* 130 */     return this.params;
/*     */   }
/*     */
/*     */   public void params(ParameterDescription[] arg)
/*     */   {
/* 135 */     throw new BAD_INV_ORDER("Cannot change RMI/IIOP mapping.");
/*     */   }
/*     */
/*     */   public OperationMode mode()
/*     */   {
/* 141 */     return OperationMode.OP_NORMAL;
/*     */   }
/*     */
/*     */   public void mode(OperationMode arg)
/*     */   {
/* 146 */     throw new BAD_INV_ORDER("Cannot change RMI/IIOP mapping.");
/*     */   }
/*     */
/*     */   public String[] contexts()
/*     */   {
/* 152 */     return new String[0];
/*     */   }
/*     */
/*     */   public void contexts(String[] arg)
/*     */   {
/* 157 */     throw new BAD_INV_ORDER("Cannot change RMI/IIOP mapping.");
/*     */   }
/*     */
/*     */   public ExceptionDef[] exceptions()
/*     */   {
/* 162 */     return this.exceptions;
/*     */   }
/*     */
/*     */   public void exceptions(ExceptionDef[] arg)
/*     */   {
/* 167 */     throw new BAD_INV_ORDER("Cannot change RMI/IIOP mapping.");
/*     */   }
/*     */
/*     */   public Description describe()
/*     */   {
/* 174 */     String defined_in_id = "IR";
/*     */
/* 176 */     if ((this.defined_in instanceof ContainedOperations)) {
/* 177 */       defined_in_id = ((ContainedOperations)this.defined_in).id();
/*     */     }
/*     */
/* 180 */     ExceptionDescription[] exds = new ExceptionDescription[this.exceptions.length];
/* 181 */     for (int i = 0; i < this.exceptions.length; i++) {
/* 182 */       Description d = this.exceptions[i].describe();
/* 183 */       exds[i] = ExceptionDescriptionHelper.extract(d.value);
/*     */     }
/*     */
/* 187 */     OperationDescription od = new OperationDescription(this.name, this.id, defined_in_id, this.version, this.typeCode, mode(), contexts(), params(), exds);
/*     */
/* 190 */     Any any = getORB().create_any();
/*     */
/* 192 */     OperationDescriptionHelper.insert(any, od);
/*     */
/* 194 */     return new Description(DefinitionKind.dk_Operation, any);
/*     */   }
/*     */ }

/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
* Qualified Name:     org.jboss.iiop.rmi.ir.OperationDefImpl
* JD-Core Version:    0.6.0
*/
TOP

Related Classes of org.jboss.iiop.rmi.ir.OperationDefImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.