2015년 4월 14일 화요일

cooKING the JaVa & mayKING the Adf

cooKING the JaVa & mayKING the Adf

slow~ slower~~ slowest~~~

NOT unBelievable!

leT's AnBelievable?


be has desirable traits.

2015년 4월 9일 목요일

CRUD– Retrieve, Delete, Create, Update Employee

CRUD– Retrieve, Delete, Create, Update Employee

base of base

it is starting for ENJOY the ADF.

MVC model N BS

DO NOT FORGET.

MVC & BS !!!



i will be make the my world wide web site by ADF!

i will be make the my world wide web site by ADF!

be stay
be wait
be...

i will
will be

i like creating something!

it's so exciting

2015년 4월 8일 수요일

인생의 목적은 이기는 것이 아니다(Not the purpose of life is victory)

인생의 목적은 이기는 것이 아니다
인생의 목적은 이기는 것이 아니다.
인생의 목적은 성장하고 나누는데 있다.
당신이 그동안 살아오면서 행한 것들을 돌이켜 볼 때,
당신은 다른 사람들을 앞지르거나 이겼을 때보다
다른 사람의 삶을 기쁘게 해준 것에서
더 큰 만족감을 느낄 것이다.
- 랍비 헤럴드 쿠시너
촌철활인 : 한치의 혀로 사람을 살린다!
이기는 것이 아니라, 어제보다 나은 나를 만들어 가는 것이
인생의 목적이어야 합니다.
끝없는 학습과 노력의 결과 산출되는 성장의 과실을
주위와 더불어 나누는 것이야 말로
진정한 보람과 행복의 원천입니다.




Not the purpose of life is victory
The purpose of life is not a victory.
Purpose of life, you divide by growth.
In retrospect what you were done have lived up to this,
You can either overtake other people, than when you win
Because I me happy the lives of other people
I feel a greater sense of satisfaction.
- Rabbi Herald comb you
Chong Chul Katsu-jin: to take advantage of the tongue's an inch!
Rather than win, and that it will make me better than yesterday
You must be a purpose in life.
The fruit of growth, which is a result of calculating the effort and infinite learning
What be divided with around
This is true of rewarding a source of happiness.




人生の目的は勝利ではない
人生の目的は勝利ではない。
人生の目的は、成長して分けるのです。
あなたがこれまで生きてきて行ったものを振り返ってみると、
あなたは、他の人々を追い抜くか、勝ったときよりも
 他の人の生活を喜んでくれたから
 より大きな満足感を感じる。
- ラビヘラルドクシあなた
チョンチョル活人:一寸の舌人を生かす!
勝つのではなく、昨日より良い私に作っていくこと
 人生の目的である必要があります。
無限の学習と努力の結果算出される成長の果実を
 周りと一緒に分けることこそ
 真のやりがいと幸福の源です。

2015년 4월 7일 화요일

추운 겨울을 보낸 나무가 더 아름다운 꽃을 피운다(Bloom tree spent the cold winter is beautiful flowers)




enJoy the true hardship and trials,




추운 겨울을 보낸 나무가 더 아름다운 꽃을 피운다
튤립은 땅에 심기 전 50일간 영하 5도로
‘고통’을 줘야 구근이 꽃을 품는다.
저온에 노출시키지 않으면 꽃이 피지 않거나
자라도 비실거리다 죽어버린다.
- 김군소, 에버랜드 식물환경연구소장
촌철활인 : 한치의 혀로 사람을 살린다!
추운 겨울을 보낸 봄 나무들이 더 아름다운 꽃을 피우듯이,
진정한 고난과 시련을 경험하지 않은 사람은
크게 성장할 수 없습니다.
꿈과 목표를 가진 사람은 누구나 아플 수밖에 없습니다.
모든 고통은 큰 꿈을 가진 사람의 벗입니다.


Bloom tree spent the cold winter is beautiful flowers
Tulips, 50 days before planting in the ground below zero 5 degrees
You have a bulb flower if it be given the "pain".
Or flowers if you do not exposed to low temperature is not bloom
Will die also that it is unrealistic species in person.
- Kim Mr. cattle, Everland plant environment Institute length
Chong Chul Katsu-jin: to take advantage of the tongue's an inch!
Spent the cold winter, as spring trees suck more beautiful flowers,
People who have not experienced the true hardship and trials,
You will not be able to grow larger.
There is only anyone hurts people who have dreams and goals.
All suffering is a friend of the people who have big dreams.

寒い冬を過ごした木が美しい花を咲かせる
チューリップは、地面に植え前50日間零下5度
「痛み」を与えなければなら球根花を持っている。
低温にさらさない場合花が咲かないか
 者でも非現実の種だと死んでしまう。
- キム君牛、エバーランド植物環境研究所長
チョンチョル活人:一寸の舌人を生かす!
寒い冬を過ごし、春の木がより美しい花を吸うように、
真の苦難と試練を経験していない人は、
 大きく成長することができません。
夢や目標を持っている人は誰でも痛いしかありません。
すべての苦しみは、大きな夢を持っている人の友です。

2015년 4월 6일 월요일

사람의 마음을 얻는 방법(Methods for obtaining human mind)

사람의 마음을 얻는 방법
보라. 훌륭한 리더는 위험이 있을 때 앞장서지만,
축하할 일이 있을 때에는 뒷전에 선다.
주변 사람들의 협력을 원한다면
그들이 스스로 중요한 사람으로 느끼게 만들어라.
겸손하게 행하라.
- 넬슨 만델라
촌철활인 : 한치의 혀로 사람을 살린다!
리더는 다른 사람들의 힘을 빌려
탁월한 성과를 창출하는 사람입니다.
지위와 권력만으로 사람을 움직이는 시대는 지나갔습니다.
존중, 겸손, 배려, 솔선수범, 책임, 헌신 등
바람직한 영향력이 쌓이고 쌓여야만
비로소 사람들의 마음이 움직이기 시작합니다.




Methods for obtaining human mind
Please look. Good leader, but he at the beginning when there is a risk,
You are standing on the back burner when there is day to celebrate.
If you need the cooperation of People around
They Make feel to important people of his own.
Sparingly and do please.
- Nelson Mandela
Chong Chul Katsu-jin: to take advantage of the tongue's an inch!
Leader the help of other people
It is intended to create excellent results.
Era to move the people only in status and power was gone.
Respect, humility, compassion, lead by example, responsibility, dedication, etc.
And what piled up preferable influential piled up
For the first time of the human mind will begin to move.



人の心を得る方法
見てください。優れたリーダーは、危険性があるとき先頭にだが、
お祝いする日があるときは後回しに立っている。
周辺の人々の協力が必要な場合
彼らは自分自身の重要な人に感じさせる作りなさい。
控えめに行いなさい。
- ネルソン·マンデラ
チョンチョル活人:一寸の舌人を生かす!
リーダーは他の人々の力を借りて
優れた成果を創出するものです。
地位と権力だけで人を動かす時代は過ぎ去りました。
尊重、謙虚、思いやり、率先垂範、責任、献身など
好ましい影響力が積もって積もってこそ
初めての人の心が動き始めます。

2015년 4월 5일 일요일




자기를 이기는 사람이 가장 강한 사람이다(Is the most strong people who win in their)

자기를 이기는 사람이 가장 강한 사람이다
돌이켜 보면 내 인생은
장애물 뛰어넘기 경주와 같았다.
그런데 그 장애물 중에서 가장 어려운 것은
바로 나 자신이었다.
- 코미디언 잭 파(Jack Parr)
촌철활인 : 한치의 혀로 사람을 살린다!
성공하지 못한 사람들은 대부분 그 원인을 남 탓,
환경 탓으로 돌리는 경향이 있습니다.
습관적으로 남 탓을 하는 사람들은 결코 변화하지 못합니다.
변화해야 할 것은 남이나 환경이 아니라
바로 나 자신이라는 정직함과 용기에서
비로소 변화와 발전이 시작됩니다.




Is the most strong people who win in their
In retrospect, my life,
Seemed to be an obstacle jumping race.
However, the most difficult in the obstacle
It was myself immediately.
- Comedian Jack wave (Jack Parr)
Chong Chul Katsu-jin: to take advantage of the tongue's an inch!
And unsuccessful people, mostly because the cause of others,
There is a tendency to blame the environment.
Habitually person to blame others does not change in any way.
It is not the others and the environment that must be changed,
Immediately in the honesty and courage of their own
First change and development is initiated.



自分に勝つ人が最も強い人である
振り返ってみると、私の人生は、
障害物跳躍レースのようだった。
ところが、その障害物の中で最も難しいのは
すぐに自分自身だった。
- コメディアンジャック波(Jack Parr)
チョンチョル活人:一寸の舌人を生かす!
成功しなかった人々は、ほとんどその原因を他人のせい、
環境のせいにする傾向があります。
習慣的に他人のせいにする人は決して変わらません。
変化しなければならないことは他人や環境ではなく、
すぐに自分自身という誠実さと勇気で
初めて変化と発展が開始されます。

2015년 4월 1일 수요일

Life is....






Life is....


























Egg!

Life is egg.

낙관론자의 생각, 비관론자의 생각(The idea of optimist, thought of pessimists)

낙관론자의 생각, 비관론자의 생각
낙관론자들은 불쾌한 일을 경험하면 다음과 같이 생각한다.
불쾌한 일은 1. 지나간다.
2. 인생의 일부분에만 관계된다.
3. 그냥 운이 없었던 것뿐이다.
유쾌한 일에 대해서는 다음과 같이 생각한다.
유쾌한 일은 1. 유지되거나 다시 찾아온다.
2. 삶의 모든 영역에 영향을 미친다.
3. 자신의 능력에 달려있다.
- 마틴 셀리그만
촌철활인 : 한치의 혀로 사람을 살린다!
반면, 비관론자들은 불쾌한 일은
1. 지속된다.
2. 인생 전반을 쥐고 흔든다.
3. 자신의 잘못 때문에 발생한다고 생각하고,
유쾌한 일은
1. 지나간다.
2. 제한되어있다.
3. 순전히 운에 달려있다고 생각합니다.
나는 과연 어느 쪽일까요?



楽観主義者の考え、悲観論者の考え
楽観主義者は不愉快な仕事を経験すると、次のように考えている。
不快なことは1スイープ。
2.人生の一部分のみになる。
3.ただ運がなかっただけだ。
愉快な日には、次のように考えている。
愉快なことは1維持または再訪れる。
2.生活のあらゆる分野に影響を与える。
3.自分の能力に依存している。
- マーティンセルリグのみ
チョンチョル活人:一寸の舌人を生かす!
一方、悲観論者は、不快なことは
1.持続する。
2.人生全般を握って振る。
3.自分の過ちのために発生すると考えて、
愉快なことは
1.スイープ。
2.制限されている。
3.そんなに運にかかっていると思います。
私は果たしてどちらでしょうか?




The idea of optimist, thought of pessimists
When optimist to experience the unpleasant job, are thought to be as follows.
Unpleasant thing
1. sweep.
2. become only a part of life.
3. I just simply did not have luck.
In pleasant day, I have no idea in the following manner.
1. Funny thing is visit one maintain or re.
2. affecting all areas of life.
3. I rely on my ability.
- Martin cell rig only

Chong Chul Katsu-jin:
to take advantage of the tongue's an inch!
On the other hand, pessimist, it uncomfortable
1. persist.
2. Shake Squeeze the life in general.
3. thought to occur because of their mistakes,
Funny thing
1. sweep.
2. is limited.
3. I think that it depends on so much luck.
I would either really?




from - http://www.happyceo.co.kr/Default.aspx 2015-04-02





About Oracle ADF Faces

Note: Because ADF Faces adheres to the standards of the JSF
technology, this guide is mostly concerned with content that is in
addition to, or different from, JSF standards. Therefore, it is
recommended that you have a basic understanding of how JSF works
before beginning to develop with ADF Faces. To learn more about JSF,
see
http://www.oracle.com/technetwork/java/javaee/documentation/index-137726.html




recommended, recommended: recommended; recommended.



---------------------------------------------------------------------------------------------




from - Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework.pdf




recommended???

2015년 3월 31일 화요일

Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework





enJoyAdf~




Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework

https://docs.oracle.com/cd/E16162_01/web.1112/e16181/toc.htm




Just Beginning!




Using a Managed Bean in a Fusion Web Application.odt





24.4 Using a Managed Bean in a Fusion Web Application

Managed beans are Java classes that you register with the application using various configuration files. When the JSF application starts up, it parses these configuration files, and the beans listed within them are made available. The managed beans can be referenced in an EL expression, allowing access to the beans' properties and methods. Whenever a managed bean is referenced for the first time and it does not already exist, the Managed Bean Creation Facility instantiates the bean by calling the default constructor method on it. If any properties are also declared, they are populated with the declared default values.
Often, managed beans handle events or some manipulation of data that is best handled at the front end. For a more complete description of how managed beans are used in a standard JSF application, see the Java EE 5 tutorial on Sun's web site (http://java.sun.comOpens a new window).
Best Practice:
Use managed beans to store logic that is related to the UI rendering only. All application data and processing should be handled by logic in the business layer of the application. Similar to how you store data-related logic in the database using PL/SQL rather than a Java class, the rule of thumb in a Fusion web application is to store business-related logic in the middle tier. This way, you can expose this logic as business service methods, which can then become accessible to the ADF Model layer and be available for data binding.
In an application that uses ADF data binding and ADF task flows, managed beans are registered in different configuration files from those used for a standard JSF application. In a standard JSF application, managed beans are registered in the faces-config.xml configuration file. In a Fusion web application, managed beans can be registered in the faces-config.xml file, theadfc-config.xml file, or a task flow definition file. Which configuration file you use to register a managed bean depends on what will need to access that bean, whether or not it needs to be customized at runtime, what the bean's scope is, and in what order all the beans in the application need to be instantiated. Table 24-1 describes how registering a bean in each type of configuration file affects the bean.
Note:
Registering managed beans within the faces-config.xml file is not recommended in a Fusion web application.
Managed beans accessed within the task flow definition must be registered in that task flow's definition file.
Table 24-1 Effects of Managed Bean Configuration Placement
Managed Bean Placement
Effect
adfc-config.xml
  • Managed bean can be of any scope. However, any backing beans for page fragments or declarative components should use BackingBean scope. For more information regarding scope, see Section 25.3, "About Object Scope Lifecycles."
  • When executing within an unbounded task flow,faces-config.xml will be checked for managed bean definitions before the adfc-config.xml file.
  • Lookup precedence is enforced per scope. Request-scoped managed beans take precedence over session-scoped managed beans. Therefore, a request-scoped managed bean named foo in the adfc-config.xml file will take precedence over a session-scoped managed bean namedfoo in the current task flow definition file.
  • Already instantiated beans take precedence over new instances being instantiated. Therefore, an existing session-scoped managed bean named foo will always take precedence over a request-scoped bean named foo defined in the current task flow definition file.
Task flow definition file
  • Managed bean can be of any scope. However, managed beans of request scope, of pageFlow scope, of viewscope, or with the scope set to none that are to be accessed within the task flow definition must be defined within the task flow definition file. Any backing beans for page fragments in a task flow should use BackingBean scope.
  • Managed bean definitions within task flow definition files will be visible only to activities executing within the same task flow.
  • When executing within a bounded task flow,faces-config.xml will be checked for managed bean definitions before the currently executing task flow definition. If no match is found in either location, adfc-config.xmland other bootstrap configuration files will be consulted. However, this lookup in other adfc-config.xml and bootstrap configuration files will only occur for session- or application-scoped managed beans.
  • Lookup precedence is enforced per scope. Request-scoped managed beans take precedence over session-scoped managed beans. Therefore, a request-scoped managed bean named foo in the adfc-config.xml file will take precedence over a session-scoped managed bean namedfoo in the current task flow definition file.
  • Already instantiated beans take precedence over new instances being instantiated. Therefore, an existing session-scoped managed bean named foo will always take precedence over a request-scoped bean named fooregistered in the current task flow definition file.
  • Customizations are allowed.
faces-config.xml
  • Managed beans can be of any scope other than pageFlowscope or view scope.
  • When searching for any managed bean, thefaces-config.xml file is always consulted first. Other configuration files will be searched only if a match is not found. Therefore, beans registered in thefaces-config.xml file will always win any naming conflict resolution.
  • No customizations can be made.


As a general rule for Fusion web applications, a bean that may be used in more than one page or task flow, or one that is used by pages within the main unbounded task flow (adfc-config), should be registered in the adfc-config.xml configuration file. A managed bean that will be used only by a specific task flow should be registered in that task flow's definition file. There should be no beans registered in the faces-config.xml file.
Note:
If you create managed beans from dialogs within JDeveloper, the bean is registered in the adfc-config.xml file, if it exists.
For example, in the StoreFront module, the myOrdersBean managed bean is used by the myOrders.jspx page to handle the case where a user decides to cancel editing an order, and the edits have already been committed to the model but have not yet been persisted to the database. Because this bean is used by a page within the adfc-config unbounded task flow, it is registered in theadfc-config.xml file. The custRegBasicInformationBean is a managed bean used by the basicInformation JSF fragment to handle the selections in the shuttle component on that page. Because it is used solely within the customer-registration task flow, it is registered in the customer-registration-task-flow definition file.
This section describes how to create a managed bean for use within a task flow (either the default adfc-config flow or any bounded task flow). For more information regarding managed beans and how they are used as backing beans for JSF pages, see the "Creating and Using Managed Beans" section in the Oracle Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework.

24.4.1 How to Use a Managed Bean to Store Information

Within the editors for a task flow definition, you can create a managed bean and register it with the JSF application at the same time.
Before you begin:
It may help to understand the options that are available to you when you create a managed bean. For more information, see Section 24.4, "Using a Managed Bean in a Fusion Web Application."
You may also find it useful to understand additional functionality that can be used with managed beans. For more information, see Section 24.1.2, "Additional Functionality for Page Templates and Managed Beans."
You will need to complete this task:
Create the configuration file (if it doesn't already exist) that you want the managed bean to be associated with. This can be faces-config.xmladfc-config.xml, or a bounded task flow definition file.
To create a managed bean for a task flow:
  1. In the Application Navigator, double-click either the adfc-config.xml file or any other task flow definition file.
  2. At the bottom of the window, click the Overview tab.
  3. In the overview editor, click the Managed Beans navigation tab. Figure 24-3 shows the editor for the adfc-config.xml file.
    Figure 24-3 Managed Beans in the adfc-config.xml File
    The JSF Configuration Editor shows all the managed beans
  4. Click the Add icon to add a row to the Managed Beans table.
  5. In the fields, enter the following:
    • managed-bean-name: A name for the bean.
    • managed-bean-class: If the corresponding class has already been created for the bean, use the browse (...) button for the managed-bean-class field to search for and select the class. If a class does not exist, enter the name you'd like to use. Be sure to include any package names as well. You can then use the drop-down menu to choose Generate Class, and the Java file will be created for you.
    • managed-bean-scope: The bean's scope. For more information about the different object scopes, see Section 25.3, "About Object Scope Lifecycles."
      Note:
      When determining what scope to register a managed bean with or to store a value in, keep the following in mind:
      • Always try to use the narrowest scope possible.
      • If your managed bean takes part in component binding by accepting and returning component instances (that is, if UI components on the page use the binding attribute to bind to component properties on the bean), then the managed bean must be stored in BackingBean scope. If it can't be stored in one of those scopes (for example, if it needs to be stored insessionScope for high availability reasons), then instead of using component binding, you need to use the ComponentReference API. For more information, see the “What You May Need to Know About Component Bindings and Managed Beans” section of the Oracle Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework
      • Use the sessionScope scope only for information that is relevant to the whole session, such as user or context information. Avoid using the sessionScope scope to pass values from one page to another.
      • You can also set the scope to none. While not technically a scope, none means that the bean will not live within any particular scope, but will instead be instantiated each time it is referenced. You should set a bean's scope to none when it is referenced by another bean.
  6. You can optionally add needed properties for the bean. With the bean selected in the Managed Beans table, click the Add icon for the Managed Properties table. Enter a property name (other fields are optional).
    Note:
    While you can declare managed properties using this editor, the corresponding code is not generated on the Java class. You will need to add that code by creating private member fields of the appropriate type and then using the Generate Accessors menu item on the context menu of the source editor to generate the corresponding getter and setter methods for these bean properties.

24.4.2 What Happens When You Create a Managed Bean

When you use the configuration editor to create a managed bean and elect to generate the Java file, JDeveloper creates a stub class with the given name and a default constructor. Example 24-6 shows the code added to the MyBean class stored in the view package.
Example 24-6 Generated Code for a Managed Bean
package view;
 
public class MyBean {
    public MyBean() {
    }
}
You now need to add the logic required by your task flow or page. You can then refer to that logic using an EL expression that refers to the managed-bean-name value given to the managed bean. For example, to access the myInfo property on the bean, the EL expression would be:
#{my_bean.myInfo}
JDeveloper also adds a managed-bean element to the appropriate task definition file. Example 24-7 shows the managed-bean element created for the MyBean class.
Example 24-7 Managed Bean Configuration on the adfc-config.xml File
<managed-bean>
  <managed-bean-name>my_bean</managed-bean-name>
  <managed-bean-class>view.MyBean</managed-bean-class>
  <managed-bean-scope>session</managed-bean-scope>
</managed-bean>

24.4.3 How to Set Managed Bean Memory Scopes in a Server-Cluster Environment

Typically, in an application that runs in a clustered environment, a portion of the application's state is serialized and copied to another server or a data store at the end of each request so that the state is available to other servers in the cluster.
Note:
If the managed bean will be calling set and get methods on ADF Faces components, you cannot serialize the managed beans because ADF Faces components are not serializable. You will need to access the ADF Faces components in another way.
When you are designing an application to run in a clustered environment, you must:
  • Ensure that all managed beans with a lifespan longer than one request are serializable (that is, they implement the java.io.Serializable interface). Specifically, beans stored in session scope, page flow scope, and view scope need to be serializable.
    Tip:
    To identify failures with objects stored in page flow scope and view scope, use writeObject(). This method provides additional information in an exception about the object and scope that failed to serialize. Additional information might be a region's page flow scope and the key of the object.
  • Make sure that the framework is aware of changes to managed beans stored in ADF scopes (view scope and page flow scope).
When a value within a managed bean in either view scope or page flow scope is modified, the application needs to notify the framework so that it can ensure that the bean's new value is replicated.
In Example 24-8, an attribute of an object in view scope is modified.
Example 24-8 Code That Modifies an Object in viewScope
Map<String, Object> viewScope =
    AdfFacesContext.getCurrentInstance().getViewScope();
MyObject obj = (MyObject)viewScope.get("myObjectName");
Obj.setFoo("newValue");
Without additional code, the framework will be unaware of this change and it will not know that a new value needs to be replicated within the cluster. To inform the framework that an object in an ADF scope has been modified and that replication is needed, use the markScopeDirty() method, as shown in Example 24-9. The markScopeDirty() method accepts only viewScope andpageFlowScope as parameters.
Example 24-9 Additional Code to Notify Oracle ADF of Changes to an Object
  ControllerContext ctx = ControllerContext.getInstance();
        ctx.markScopeDirty(viewScope);
This code is needed for any request that modifies an existing object in one of the ADF scopes. If the scope itself is modified by the scope's put()remove(), or clear() methods, it is not necessary to notify the framework.
If an application is not deployed to a clustered environment, the tracking of changes to ADF memory scopes is not needed, and by default, this functionality is disabled. To enable ADF Controller to track changes to ADF memory scopes and replicate the page flow scope and view scope within the server cluster, set the <adf-scope-ha-support> parameter in the adf-config.xml file to true. Because scope replication has a small performance overhead, it should be enabled only for applications running in a server-cluster environment.
Example 24-10 shows adf-scope-ha-support set to true in the adf-config.xml file.
Example 24-10 adf-scope-ha-support Parameter in the adf-config.xml File
<?xml version="1.0" encoding="US-ASCII" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config"
      xmlns:adfc="http://xmlns.oracle.com/adf/controller/config">
   <adfc:adf-controller-config>
...
    <adfc:adf-scope-ha-support>true</adfc:adf-scope-ha-support>
...
  </adfc:adf-controller-config>
...
</adf-config>

























Fusion WebアプリケーションでのマネージドBeanの使用24.4

管理Beanは、さまざまな構成ファイルを使用してアプリケーションに登録するJavaクラスです。 JSFアプリケーションが起動すると、それは、これらの設定ファイルを解析し、その中に記載されている豆を利用できるようになります。管理対象Beanは、Beanのプロパティとメソッドへのアクセスを可能にする、EL式で参照することができます。管理対象Beanが初めて参照されたし、それがすでに存在していないときはいつでも、マネージドBean作成機能は、その上にデフォルトコンストラクタメソッドを呼び出してBeanをインスタンス化します。任意のプロパティも宣言されている場合は、それらが宣言されたデフォルト値が入力されています。

多くの場合、管理対象Beanは、イベントや最高のフロントエンドで処理されたデータの一部の操作を処理します。標準JSFアプリケーションで使用されているかを管理対象Beanのより完全な説明については、SunWebサイト上でのJava EE 5チュートリアルを参照してください(HTTPを:新しいウィンドウを//java.sun.comOpens)。

ベストプラクティス:
唯一のレンダリングUIに関連しているロジックを格納する管理対象Beanを使用してください。すべてのアプリケーションデータ、処理は、アプリケーションのビジネス層のロジックによって処理されるべきである。あなたは、PL / SQLではなく、Javaクラスを使用して、データベース内のデータ関連のロジックを格納する方法と同様に、Fusion Webアプリケーションでの経験則では、中間層でビジネス関連のロジックを格納することです。このように、あなたはその後ADFモデル層にアクセス可能になるとデータバインディングの利用可能であるビジネス·サービス·メソッド、としてこのロジックを公開することができます。
ADFデータ·バインディングとADFタスク·フローを使用するアプリケーションでは、管理対象Beanは、標準JSFアプリケーションのために使用されるものから異なる設定ファイルに登録されている。標準JSFアプリケーションでは、管理対象Beanは、faces-config.xml構成ファイルに登録されている。 Fusion Webアプリケーションでは、管理対象Beanは、faces-config.xmlファイル、ADFC-config.xmlファイル、またはタスク·フロー定義ファイルに登録することができます。どの構成管理対象Beanを登録するために使用するファイルは、それがBeanのスコープが何であるか、実行時に、カスタマイズする必要があり、どのような順序で、アプリケーション内のすべてのBeanがする必要があるかどうか、そのBeanにアクセスするために必要なものに依存しますインスタンス化。表24-1は、設定ファイルの各タイプでBeanを登録すると、Beanをどのように影響するかについて説明します。

注意:
faces-config.xmlファイル内で管理豆を登録すると、Fusion Webアプリケーションで推奨されていません。
タスク·フロー定義内でアクセスマネージドBeanは、そのタスク·フローの定義ファイルに登録する必要があります。

マネージドBeanの構成配置の表24-1に及ぼす影響

マネージドBeanの配置の影響
ADFC-config.xml

マネージドBeanは任意のスコープのものであってもよい。ただし、ページ·フラグメントまたは宣言コンポーネントのための任意のバッキングBeanは、BackingBeanスコープを使用する必要があります。スコープの詳細については、「オブジェクト·スコープ·ライフサイクルについて」、第25.3を参照してください。

バインドなしタスク·フロー内で実行すると、直面している-config.xmlADFC-config.xmlファイルの前に管理Bean定義がチェックされます。

ルックアップの優先順位はスコープごとに強制されている。リクエスト·スコープのマネージドBeanは、セッションスコープの管理対象Beanより優先されます。したがって、ADFC-config.xmlファイルにfooというリクエスト·スコープのマネージドBeanは、現在のタスク·フロー定義ファイルのfooというセッション·スコープのマネージドBeanより優先されます。

既にインスタンスBeanは、インスタンス化されている新しいインスタンスよりも優先されます。そのため、fooという既存のセッション·スコープのマネージドBeanは、常に現在のタスク·フロー定義ファイルで定義されたfooという名前のリクエスト·スコープのBeanより優先されます。

タスク·フロー定義ファイル

マネージドBeanは任意のスコープのものであってもよい。しかし、ページフロースコープの、ビューの範囲を、またはタスク·フロー定義ファイル内で定義されなければならないタスク·フロー定義内でアクセスされるnoneに設定範囲で、リクエストスコープの豆を管理していました。タスク·フロー内のページ·フラグメントのための任意のバッキングBeanは、BackingBeanスコープを使用する必要があります。

タスク·フロー定義ファイル内で管理Bean定義は、同じタスク·フロー内で実行活動に表示されます。

バインド·タスク·フロー内で実行すると、直面している-config.xmlには、現在実行中のタスク·フロー定義の前に管理対象Beanの定義がチェックされます。一致がどちらの場所に見つからない場合、ADFC-config.xmlおよび他のブートストラップコンフィギュレーションファイルが参照されます。しかし、他のadfc-config.xmlおよびブートストラップコンフィギュレーションファイル内のこのルックアップは唯一のセッションまたはアプリケーションスコープの管理対象Beanのために発生します。

ルックアップの優先順位はスコープごとに強制されている。リクエスト·スコープのマネージドBeanは、セッションスコープの管理対象Beanより優先されます。したがって、ADFC-config.xmlファイルにfooというリクエスト·スコープのマネージドBeanは、現在のタスク·フロー定義ファイルのfooというセッション·スコープのマネージドBeanより優先されます。

既にインスタンスBeanは、インスタンス化されている新しいインスタンスよりも優先されます。そのため、fooという既存のセッション·スコープのマネージドBeanは、常に現在のタスク·フロー定義ファイルに登録fooという名前のリクエスト·スコープのBeanより優先されます。

カスタマイズが許可されています。

-config.xml

マネージドBeanは、ページフロースコープまたはビューのスコープ以外のスコープのものであってもよい。

すべての管理対象Beanを検索する場合、faces-config.xmlファイルは、常に最初に参照されます。他の設定ファイルは、一致が見つからない場合にのみ検索されます。そのため、faces-config.xmlファイルに登録さBeanは、常に名前の競合解決を獲得します。

いいえカスタマイズが行うことはできません。


一般的なFusion Webアプリケーションのためのルール、複数のページまたはタスク·フローで使用することができる豆、またはメインバインドなしタスク·フロー(ADFC-configの)内のページで使用されている一つとして、adfc-に登録する必要がありますconfig.xml構成ファイル。特定のタスク·フローによってのみ使用される管理対象Beanは、そのタスク·フローの定義ファイルに登録する必要があります。 faces-config.xmlファイルに登録され豆があってはならない。

注意:
あなたはJDeveloper内のダイアログから管理対象Beanを作成した場合、それが存在する場合、Beanは、ADFC-config.xmlファイルに登録されている。
たとえば、StoreFrontモジュールでは、myOrdersBeanは、Beanは、ユーザーが注文の編集をキャンセルすることを決定した場合に対処するためにmyOrders.jspxページで使用されて管理され、編集はすでにモデルにコミットされたが、まだ保存されていないかデータベースへ。このBeanADFC-configのバインドなしタスク·フロー内のページで使用されているので、それはADFC-config.xmlファイルに登録されている。 custRegBasicInformationBeanは、そのページ上でシャトル·コンポーネントでの選択を処理するためにbasicInformation JSFフラグメントが使用する管理対象Beanである。それは、顧客の登録タスク·フロー内で単独で使用されるため、顧客の登録タスク·フロー定義ファイルに登録されている。

このセクションでは、タスク·フロー(デフォルトのadfc-configのフローまたはバインド·タスク·フローのいずれか)内で使用するための管理対象Beanを作成する方法について説明します。もっと管理Beanに関する情報とそれらがどのようにJSFページのバッキングBeanとして使用されている場合、Oracle Application Development FrameworkのためのOracle Fusion MiddlewareWebユーザー·インタフェース開発者ガイド」のマネージドBeanの作成と使用」を参照してください。

24.4.1情報の格納マネージドBeanを使用する方法

タスク·フロー定義のためのエディタ内では、管理対象Beanを作成することができ、同時にJSFアプリケーションに登録します。

始める前に:

それはあなたが管理Beanを作成するときに使用できるオプションを理解するのに役立つことがあります。詳細については、「Fusion WebアプリケーションでのマネージドBeanの使用」のセクション24.4を参照してください。

また、それが便利な管理Beanで使用できる追加機能を理解することがあります。詳細については、項24.1.2を参照してください「ページ·テンプレートと管理Beanのための追加機能を。」

あなたは、このタスクを完了する必要があります。

(それがまだ存在していない場合)、管理対象Beanが関連付けられていることがしたいことを設定ファイルを作成します。これは顔-config.xmlに、ADFC-config.xmlに、またはバインド·タスク·フロー定義ファイルとすることができます。
タスク·フローの管理ビーンを作成するには:

アプリケーション·ナビゲータで、ADFC-config.xmlファイルまたはその他のタスク·フロー定義ファイルのいずれかをダブルクリックします。

ウィンドウの下部には、[概要]タブをクリックします。

概要エディタでは、管理Beanナビゲーション·タブをクリックします。図24-3は、ADFC-config.xmlファイルのエディタを示しています。

ADFC-config.xmlファイルで24-3マネージドBeanの図

JSF構成エディタは、すべての管理対象Beanを示しています
管理Beanテーブルに行を追加するには、[追加]アイコンをクリックします。

フィールドでは、次のように入力します。

管理対象豆名:Beanの名前。

管理対象のBeanクラス:対応するクラスがすでに豆のために作成されている場合は、検索し、クラスを選択するために管理·ビーン·クラスのフィールドの参照(...)ボタンを使用します。クラスが存在しない場合は、使用したい名前を入力します。同様に、任意のパッケージ名を含めるようにしてください。その後、クラスの生成を選択するドロップダウンメニューを使用することができ、およびJavaファイルが作成されます。

管理対象Beanにスコープ:Beanのスコープ。異なるオブジェクトのスコープの詳細については、「オブジェクト·スコープ·ライフサイクルについて」、第25.3を参照してください。

注意:
で管理対象Beanを登録するか、値を格納するためにどのような範囲を決定した場合、次の点に注意してください:
常に可能な狭い範囲を使用するようにしてください。

管理対象Beanは(ページ上のUIコンポーネントがBean上のコンポーネントのプロパティにバインドするバインディング属性を使用している場合つまり、)コンポーネントのインスタンスを受け入れ、返すことによって結合成分に参加する場合は、管理対象BeanBackingBeanスコープに格納する必要があります。それは、これらのスコープのいずれかに格納できない場合には(それは、高可用性の理由でsessionScopeとに格納する必要がある場合など)は、代わりに結合成分の使用は、ComponentReferenceAPIを使用する必要がある。詳細は、Oracle Application Development FrameworkのためのOracle Fusion MiddlewareWebユーザー·インタフェース開発者ガイドのセクション "あなたは、コンポーネントバインディングと管理Beanについて必要な知識」を参照してください。

そのようなユーザや文脈情報として、唯一のセッション全体に関連する情報については、をsessionScopeスコープを使用してください。 1ページから別の値を渡すためにをsessionScopeスコープを使用しないでください。

また、noneにスコープを設定することができます。ていない技術的にはスコープが、どれも豆が特定の範囲内で生活することはありませんが、代わりにそれが参照されるたびにインスタンス化されることを意味しません。それは別のBeanから参照されているときには、誰にも負けない、Beanのスコープを設定する必要があります。

オプションで、豆のために必要なプロパティを追加することができます。管理Beanテーブルで選択した豆を使用すると、管理プロパティテーブルの追加]アイコンをクリックします。プロパティ名を入力します(他のフィールドはオプションです)。

注意:
あなたはこのエディタを使用して管理プロパティを宣言することができますが、対応するコードは、Javaクラス上に生成されていません。あなたは適切な型のプライベートメンバフィールドを作成し、これらのBeanプロパティのための対応するgetterメソッドとsetterメソッドを生成するために、ソースエディタのコンテキストメニューにアクセッサの生成メニュー項目を使用して、そのコードを追加する必要があります。
あなたがマネージドBeanの作成時の処理24.4.2

管理対象Beanを作成し、Javaファイルを生成することを選択するために、構成エディタを使用すると、JDeveloperは、与えられた名前とデフォルトコンストラクタでスタブクラスを作成します。例24-6は、ビューパッケージに格納されているMyBeanとクラスに追加されたコードを示しています。

24-6は、マネージドBeanのコードを生成した

パッケージ図である。

パブリッククラスMyBean{
    公共MyBeanと(​​){
    }
}
これで、あなたのタスク·フローまたはページによって必要なロジックを追加する必要があります。その後、管理対象Beanに与えられた管理対象Bean-nameの値を参照するEL式を使用してそのロジックを参照することができます。たとえば、BeanののmyInfoプロパティにアクセスするために、EL式は次のようになります。

{my_bean.myInfo}
JDeveloperは、適切なタスク定義ファイルに管理さ-bean要素が追加されます。例24-7は、MyBeanとクラスのために作成された管理-bean要素を示しています。

24-7は、ADFC-config.xmlファイルにBeanの設定のマネージド

<管理対象豆>
  <管理対象のBean> my_bean </管理対象豆名>
  <管理対象のBeanクラス> view.MyBean </管理対象のBeanクラス>
  <管理対象のBeanスコープ>セッション</管理対象Beanはスコープ>
</マネージドビーン>
サーバークラスタ環境でのマネージドBeanのメモリスコープの設定方法24.4.3

一般的には、クラスタ環境で実行されるアプリケーションでは、アプリケーションの状態の一部は、シリアル化され、状態はクラスタ内の他のサーバで使用できるように、各要求の終了時に、別のサーバまたはデータストアにコピーされます。

注意:
管理対象Beanは、セットを呼び出してもとADF Facesコンポーネントのメソッドを取得する場合はADF Facesコンポーネントがシリアライズ可能ではない新人ので、あなたは、管理対象Beanをシリアル化することはできません。あなたは、ADFが別の方法でFacesコンポーネントをアクセスする必要があります。
クラスタ環境で実行するアプリケーションを設計する際、作業を行う必要があります。

長い1要求以外の寿命を持つすべての管理対象Beanが直列化可能であることを確認します(つまり、彼らは、java.io.Serializableインタフェースを実装)。具体的には、セッションスコープに格納された豆、ページ·フロー·スコープ、およびビューのスコープは、直列化可能である必要があります。

ヒント:
ページ·フロー·スコープとビュー·スコープに保存されているオブジェクトで障害を特定するには、writeObjectメソッドを使用します()。このメソッドは、シリアル化するために失敗したオブジェクトとスコープについての例外に追加情報を提供します。追加情報は、地域のページ·フロー·スコープとオブジェクトのキー可能性があります。
フレームワークは、ADFスコープ(ビュースコープとページ·フロー·スコープ)に格納されている管理対象Beanへの変更を認識していることを確認してください。

どちらビュースコープまたはページフロー·スコープで管理対象Bean内の値を変更すると、アプリケーションは、Beanの新しい値が複製されることを保証することができるようにフレームワークを通知する必要がある。

24-8では、ビューのスコープ内のオブジェクトの属性が変更されます。

viewScopeでオブジェクトを変更する例24-8コード

地図<文字列、オブジェクト> viewScope =
    。AdfFacesContext.getCurrentInstance()getViewScope();
MyObjectOBJ =MyObjectに)viewScope.get(「myObjectName ";
Obj.setFoo(「newValue";
追加のコードがないと、フレームワークは、この変更を認識しないし、それは、新しい値は、クラスタ内で複製する必要があることを知ることができません。例24-9に示すように、markScopeDirty()メソッドを使用し、ADFスコープ内のオブジェクトが変更されたフレームワークに通知するために、その複製が必要とされている。 markScopeDirty()メソッドは、パラメータとしてのみviewScopeとなPageFlowScopeを受け入れます。

24-9オブジェクトに対する変更のOracle ADFのを通知するために追加のコード

  ControllerContext CTX = ControllerContext.getInstance();
        ctx.markScopeDirtyviewScope;
このコードは、ADFのスコープのいずれかに既存のオブジェクトを変更するすべての要求のために必要とされる。スコープ自体がスコープのputによって変更された場合())(削除、またはクリア()メソッドは、それがフレームワークに通知する必要はない。

アプリケーションがクラスタ化された環境にデプロイされていない場合は、ADFメモリー·スコープに対する変更の追跡が必要とされず、デフォルトでは、この機能は無効になっています。 ADFメモリー·スコープの変更を追跡し、ページ·フロー·スコープを複製し、サーバークラスタ内のスコープを表示するには、ADFコントローラを有効にするには、trueADF-config.xmlファイル内の<ADF-スコープ-HA-サポート>パラメータを設定します。スコープの複製は、小さなパフォーマンスのオーバーヘッドがあるので、それは、サーバークラスタ環境で実行しているアプリケーションに対してのみ有効にする必要があります。

24-10は、ADF-config.xmlファイルでtrueに設定ADF-スコープ-HA-サポートを示しています。

ADF-config.xmlファイル内の例24-10 ADF-スコープ-HA-サポートパラメータ

<xmlのバージョン= "1.0"エンコーディング= "US-ASCII">
<ADF-設定のxmlns = "http://xmlns.oracle.com/adf/config"
      のxmlnsADFC = "http://xmlns.oracle.com/adf/controller/config">
   <ADFCADF-コントローラ-config>
...
    <ADFCADF-スコープ-HA-サポート></ ADFCADF-スコープ-HA-サポート>
...
  </ ADFCADF-コントローラ-config>
...
</ ADF-config>






































Fusion Web 응용 프로그램의 관리 Bean의 사용 24.4

관리 Bean은 다양한 구성 파일을 사용하여 응용 프로그램에 등록하는 Java 클래스입니다. JSF 응용 프로그램이 시작하면 그것은 이러한 설정 파일을 분석하고 그 속에 포함되어있는 콩을 사용할 수있게됩니다. 관리 BeanBean의 속성과 메서드에 대한 액세스를 가능하게하는 EL 표현식에서 참조 할 수 있습니다. 관리 Bean이 처음 언급되었고, 그것이 이미 존재하지 않을 때마다 관리 Bean 생성 기능은 그 위에 기본 생성자 메서드를 호출하여 Bean을 인스턴스화합니다. 어떤 속성도 선언되어있는 경우에는 그들이 선언 된 디폴트 값이 입력되어 있습니다.

종종 관리 Bean은 이벤트와 최고의 프런트 엔드에서 처리 된 데이터의 일부 작업을 처리합니다. 표준 JSF 응용 프로그램에서 사용되었는지를 관리 Bean의 더 완전한 설명은 SunWeb 사이트에서 Java EE 5 자습서를 참조하십시오 (HTTP: 새로운 창을 //java.sun.comOpens ).

모범 사례 :
유일한 렌더링 UI에 관련되는 로직을 포함하는 관리 Bean을 사용하십시오. 모든 응용 프로그램 데이터 처리 응용 프로그램의 비즈니스 계층의 논리에 의해 처리되어야한다. 당신은 PL / SQL 대신 Java 클래스를 사용하여 데이터베이스의 데이터 관련 로직을 저장하는 방법과 마찬가지로 Fusion Web 응용 프로그램에서 어림짐작은 중간 계층에서 비즈니스 로직을 포함하는 것입니다. 이와 같이, 당신은 그 ADF 모델 계층에 액세스 가능하게되면 데이터 바인딩 사용할 수있는 비즈니스 서비스 메소드로이 논리를 공개 할 수 있습니다.
ADF 데이터 바인딩과 ADF 작업 흐름을 사용하는 응용 프로그램은 관리 Bean은 표준 JSF 응용 프로그램에 사용되는 것으로부터 다른 설정 파일에 등록되어있다. 표준 JSF 응용 프로그램은 관리 Beanfaces-config.xml 구성 파일에 등록되어있다. Fusion Web 어플리케이션에서는 관리 Beanfaces-config.xml 파일 ADFC-config.xml 파일 또는 작업 흐름 정의 파일에 등록 할 수 있습니다. 어떤 조직 관리 Bean을 등록하는 데 사용하는 파일은 그것이 Bean의 범위가 무엇인지 런타임에 사용자 정의해야 어떤 순서로 응용 프로그램의 모든 Bean이해야 할 있는지 그 Bean에 액세스하기 위해 필요한 것들에 의존합니다 인스턴스화. 24-1은 설정 파일의 각 유형에서 Bean을 등록하면 Bean을 어떻게 영향을 주는지에 대해 설명합니다.

주의 :
faces-config.xml 파일에서 관리 콩을 등록하면 Fusion Web 응용 프로그램에 권장되지 않습니다.
작업 흐름 정의에 액세스 관리 Bean은 작업 흐름 정의 파일에 등록해야합니다.

관리 Bean 구성 배치 표 24-1에 미치는 영향

관리 Bean의 배치의 영향
ADFC-config.xml

관리 Bean은 모든 범위의 것이어도 좋다. 그러나 페이지 단편 또는 선언 구성 요소에 대한 모든 백업 BeanBackingBean 범위를 사용해야합니다. 범위에 대한 자세한 내용은 "개체 범위 라이프 사이클에 대해"25.3을 참조하십시오.

바인딩없이 작업 흐름에서 실행하면 직면 -config.xmlADFC-config.xml 파일의 전에 관리 Bean 정의가 체크됩니다.

조회 우선 순위 범위마다 강제되어있다. 요청 범위의 관리 Bean은 세션 범위 관리 Bean보다 우선합니다. 따라서 ADFC-config.xml 파일에 foo라는 요청 범위의 관리 Bean은 현재의 작업 흐름 정의 파일의 foo라는 세션 범위의 관리 Bean보다 우선합니다.

이미 인스턴스 Bean은 인스턴스화되는 새로운 인스턴스보다 우선합니다. 따라서 foo라는 기존의 세션 범위의 관리 Bean은 항상 현재의 작업 흐름 정의 파일에 정의 된 foo라는 요청 범위 Bean보다 우선합니다.

작업 흐름 정의 파일

관리 Bean은 모든 범위의 것이어도 좋다. 그러나 페이지 흐름 범위의 뷰 범위 또는 작업 흐름 정의 파일에서 정의되어야한다 타스크 플로우 정의에서 사용되는 none으로 설정 범위에서 요청 범위의 콩을 관리하고있었습니다 . 작업 흐름의 페이지 단편 대한 모든 백업 BeanBackingBean 범위를 사용해야합니다.

작업 흐름 정의 파일에서 관리 Bean 정의는 동일한 작업 흐름에서 실행 활동에 표시됩니다.

바인드 작업 흐름에서 실행하면 직면 -config.xml에는 현재 실행중인 작업 흐름 정의 전에 관리 Bean 정의가 체크됩니다. 일치가 어느 위치에 없으면 ADFC-config.xml과 다른 부트 스트랩 구성 파일이 참조됩니다. 그러나 다른 adfc-config.xml 및 부트 스트랩 구성 파일에서이 조회 유일한 세션 또는 응용 프로그램 범위의 관리 Bean으로 인해 발생합니다.

조회 우선 순위 범위마다 강제되어있다. 요청 범위의 관리 Bean은 세션 범위 관리 Bean보다 우선합니다. 따라서 ADFC-config.xml 파일에 foo라는 요청 범위의 관리 Bean은 현재의 작업 흐름 정의 파일의 foo라는 세션 범위의 관리 Bean보다 우선합니다.

이미 인스턴스 Bean은 인스턴스화되는 새로운 인스턴스보다 우선합니다. 따라서 foo라는 기존의 세션 범위의 관리 Bean은 항상 현재의 작업 흐름 정의 파일에 등록 foo라는 요청 범위 Bean보다 우선합니다.

사용자가 허용되어 있습니다.

얼굴 -config.xml

관리 Bean은 페이지 흐름 범위 또는 뷰의 범위 이외의 범위의 것이어도 좋다.

모든 관리 Bean을 검색하려면 faces-config.xml 파일은 항상 먼저 참조됩니다. 다른 설정 파일은 일치가 발견되지 않는 경우에만 검색됩니다. 따라서 faces-config.xml 파일에 등록되는 Bean은 항상 이름 충돌 해결을 획득합니다.

아니오 사용자 정의 할 수 없습니다.


일반적인 Fusion Web 응용 프로그램을위한 규칙 여러 페이지 또는 작업 흐름에서 사용할 수있는 콩 또는 기본 바인딩없이 작업 흐름 (ADFC-config)의 페이지에서 사용되는 하나로 , adfc-에 등록해야합니다 config.xml 구성 파일. 특정 작업 흐름에 의해서만 사용되는 관리 Bean은 해당 작업 흐름의 정의 파일에 등록해야합니다. faces-config.xml 파일에 등록 된 콩이 없어야한다.

주의 :
당신은 JDeveloper의 대화에서 관리 Bean을 작성한 경우, 그것이 존재하는 경우, BeanADFC-config.xml 파일에 등록되어있다.
예를 들어, StoreFront 모듈은 myOrdersBeanBean은 사용자가 주문의 편집을 취소하기로 결정하는 경우에 대처하기 위해 myOrders.jspx 페이지에서 사용되어 관리되고 편집은 이미 모델에 커밋되었지만 아직 저장되지 않았거나 데이터베이스에. BeanADFC-config 바인딩없이 작업 플로우 페이지에서 사용되는, 그래서 ADFC-config.xml 파일에 등록되어있다. custRegBasicInformationBean 해당 페이지에서 셔틀 구성 요소의 선택을 처리하기 위해 basicInformation JSF 조각이 사용하는 관리 Bean이다. 그것은 고객의 등록 작업 흐름에서 단독으로 사용되기 때문에 고객의 등록 작업 흐름 정의 파일에 등록되어있다.

이 섹션에서는 작업 흐름 (기본 adfc-config의 흐름 또는 바인드 작업 흐름 중 하나)에서 사용하는 관리 Bean을 만드는 방법에 대해 설명합니다. 더 관리 Bean에 대한 정보와 그들이 어떻게 JSF 페이지의 백업 Bean으로 사용되는 경우 Oracle Application Development Framework를위한 Oracle Fusion MiddlewareWeb 사용자 인터페이스 개발자 가이드 "의 관리 Bean 작성 및 사용" 를 참조하십시오.

24.4.1 정보의 저장 관리 Bean을 사용하는 방법

작업 흐름 정의를위한 편집기에서 관리되는 Bean을 만들 수 있으며, 동시에 JSF 응용 프로그램에 등록합니다.

시작하기 전에 :

당신이 관리 Bean을 만들 때 사용할 수있는 옵션을 이해하는 데 도움이 될 수 있습니다. 자세한 내용은 "Fusion Web 응용 프로그램의 관리 Bean 사용"섹션 24.4을 참조하십시오.

또한, 편리한 관리 Bean에서 사용할 수있는 추가 기능을 이해할 수 있습니다. 자세한 내용은 섹션 24.1.2를 참조하십시오 "페이지 템플릿과 관리 Bean을위한 추가 기능을."

당신은이 작업을 완료해야합니다.

(그것이 아직 존재하지 않는 경우) 관리 Bean이 연결된 것이하고 싶은 것을 설정 파일을 만듭니다. 이것은 얼굴 -config.xmlADFC-config.xml에 또는 바인드 작업 흐름 정의 파일로 할 수 있습니다.
작업 흐름의 관리 빈을 만들려면 :

애플리케이션 네비게이터에서 ADFC-config.xml 파일 또는 기타 작업 흐름 정의 파일 중 하나를 더블 클릭합니다.

창 하단에 요약 탭을 클릭합니다.

개요 편집기에서는 관리 Bean 탐색 탭을 클릭합니다. 그림 24-3ADFC-config.xml 파일 편집기를 보여줍니다.

ADFC-config.xml 파일에서 24-3 관리 Bean의 그림

JSF 구성 편집기는 모든 관리 Bean을 보여줍니다
관리 Bean 테이블에 행을 추가하려면 [추가] 아이콘을 클릭합니다.

필드에서 다음과 같이 입력합니다.

관리 콩 이름 : Bean의 이름.

관리되는 Bean 클래스 : 해당 클래스가 이미 콩을 위해 작성되는 경우, 검색하고 클래스를 선택하기 위해 관리 · 빈 클래스의 필드의 참조 (...) 버튼을 사용합니다 . 클래스가 존재하지 않는 경우, 사용할 이름을 입력합니다. 마찬가지로 어떤 패키지 이름을 포함해야합니다. 그 후, 클래스의 생성을 선택 드롭 다운 메뉴를 사용 할 수 및 Java 파일이 생성됩니다.

관리 Bean에 범위 : Bean의 범위. 다른 객체의 범위에 대한 자세한 내용은 "개체 범위 라이프 사이클에 대해"25.3을 참조하십시오.

주의 :
에서 관리 Bean을 등록하거나 값을 저장하기 위해 어떤 범위를 결정하는 경우 다음 사항에주의하십시오 :
항상 가능한 좁은 범위를 사용하도록하십시오.

관리 Bean(페이지의 UI 구성 요소가 Bean의 구성 요소 속성에 바인딩 바인딩 속성을 사용하는 경우 즉,) 구성 요소의 인스턴스를 받아들이고 반환하여 결합 성분에 참여하려면 관리 BeanBackingBean 범위에 저장해야합니다. 그것은 이러한 범위 중 하나에 저장할 수없는 경우에는 (, 고 가용성의 이유로 sessionScope과에 저장할 필요가있는 경우 등) 대신 결합 성분의 사용은 ComponentReference API를 사용할 필요 이있다. 자세한 내용은 Oracle Application Development Framework를위한 Oracle Fusion MiddlewareWeb 사용자 인터페이스 개발자 가이드 섹션 "당신은 구성 요소 바인딩 및 관리 Bean에 대해 필요한 지식"을 참조하십시오.

그런 사용자와 문맥 정보로, 오직 전체 세션 관련 정보는를 sessionScope 범위를 사용하십시오. 1 페이지에서 다른 값을 전달을 sessionScope 범위를 사용하지 마십시오.

또한 none 범위를 설정할 수 있습니다. 않은 기술적으로 범위가 아무도 콩이 특정 범위 내에서 생활하는 것은 아니지만, 대신에 그것이 참조 될 때마다 인스턴스화되는 것을 의미하지 않습니다. 그것은 다른 Bean에서 참조되는 경우에는 누구에게도 뒤지지 않는 Bean의 범위를 설정해야합니다.

옵션에서 콩 데 필요한 속성을 추가 할 수 있습니다. 관리 Bean 테이블에서 선택한 콩을 사용하면 관리 속성 테이블 추가 아이콘을 클릭합니다. 속성 이름을 입력합니다 (다른 필드는 선택 사항입니다.)

주의 :
당신이 편집기를 사용하여 관리 속성을 선언 할 수 있지만 해당 코드는 Java 클래스에 생성되지 않습니다. 당신은 적절한 형태의 private 멤버 필드를 만들고 이러한 Bean 속성에 대응하는 getter 메소드와 setter 메소드를 생성하기 위해 소스 편집기의 컨텍스트 메뉴에 액세서 생성 메뉴 항목을 사용하여 그 코드를 추가해야합니다.
당신이 관리 Bean을 만들 때의 처리 24.4.2

관리 Bean을 작성하고 Java 파일을 생성하는 것을 선택하기 위해 구성 편집기를 사용하면 JDeveloper는 주어진 이름과 디폴트 생성자에서 스텁 클래스를 만듭니다. 24-6 뷰 패키지에 포함되어있는 MyBean와 클래스에 추가 된 코드를 보여줍니다.

24-6은 관리 Bean 코드를 생성 한

패키지도이다.

Public 클래스 MyBean{
공공 MyBean() {
}
}
이제 당신의 작업 흐름 또는 페이지에서 필요한 로직을 추가해야합니다. 그 관리 Bean에 주어진 관리 Bean-name 값을 참조하는 EL 식을 사용하여 논리를 참조 할 수 있습니다. 예를 들어, BeanmyInfo 속성에 액세스하기 위해 EL 표현식은 다음과 같이됩니다.

# {my_bean.myInfo}
JDeveloper는 적절한 작업 정의 파일에 관리에 -bean 요소가 추가됩니다. 24-7MyBean와 클래스를 위해 만들어진 관리 -bean 요소를 보여줍니다.

24-7ADFC-config.xml 파일에 Bean 설정 관리

<관리 콩>
<관리 대상 Bean 이름> my_bean </ 관리 콩 이름>
<관리 대상 Bean 클래스> view.MyBean </ 관리되는 Bean 클래스>
<관리 대상 Bean 범위> 세션 </ 관리 Bean은 범위>
</ 관리 빈>
서버 클러스터 환경에서의 관리 Bean의 메모리 범위 설정 방법 24.4.3

일반적으로 클러스터 환경에서 실행되는 응용 프로그램은 응용 프로그램의 상태 중 일부는 직렬화 된 상태는 클러스터의 다른 서버에서 사용할 수 있도록 각 요청의 종료시 다른 서버 또는 데이터 저장소로 복사됩니다.

주의 :
관리 Bean은 세트를 호출 해 원 ADF Faces 컴포넌트의 메소드를 취득하는 경우에는 ADF Faces 컴포넌트가 직렬화 가능하지 않은 신인 때문에, 당신은 관리 Bean을 직렬화 할 수 없습니다. 당신은 ADF가 다르게 Faces 구성 요소에 액세스해야합니다.
클러스터 환경에서 실행되는 응용 프로그램을 설계 할 때 작업을 수행해야합니다.

긴 요구 이외의 수명을 가지는 모든 관리 Bean가 직렬화 가능한지 확인합니다 (, 그들은 java.io.Serializable 인터페이스를 구현). 구체적으로는 세션 범위에 포함 된 콩, 페이지 플로우 범위 및보기의 범위는 직렬화 가능해야합니다.

:
페이지 플로우 범위와 뷰 범위에 저장된 객체에서 문제를 식별하려면 writeObject 메소드를 사용합니다 (). 이 메소드는 직렬화하는 데 실패한 객체 및 범위의 예외에 추가 정보를 제공합니다. 추가 정보는 지역의 페이지 플로우 범위와 개체의 키 수 있습니다.
프레임 워크는 ADF 범위 (뷰 범위와 페이지 플로우 범위)에 저장되어 관리 Bean에 변화를 인식하고 있는지 확인하십시오.

어느 뷰 범위 또는 페이지 플로우 범위에서 관리 Bean의 값을 변경하면 응용 프로그램은 Bean의 새로운 값이 복제되는 것을 보장 할 수 있도록 프레임 워크를 통지 할 필요가있다.

24-8에서 뷰 범위 내의 객체의 속성이 변경됩니다.

viewScope에서 객체를 변경하는 예 24-8 코드

지도 <문자열 개체> viewScope =
. AdfFacesContext.getCurrentInstance () getViewScope ();
MyObjectOBJ = (MyObject) viewScope.get ( "myObjectName");
Obj.setFoo ( "newValue");
추가 코드가 없으면 프레임 워크는 이러한 변화를 인식하지 않으며 그것은 새로운 값은 클러스터에서 복제 할 필요가 있음을 알 수 없습니다. 24-9에 나타낸 바와 같이, markScopeDirty () 메소드를 사용하여 ADF 범위 내의 개체가 변경된 프레임 워크에 알리기 위해 그 복제가 필요로되고있다. markScopeDirty () 메서드는 매개 변수로만 viewScope과 같은 PageFlowScope을 받아들입니다.

24-9 객체에 대한 변경 Oracle ADF를 알리기 위해 추가 코드

ControllerContext CTX = ControllerContext.getInstance ();
ctx.markScopeDirty (viewScope);
이 코드는 ADF의 범위 중 하나에 기존 개체를 수정하는 모든 요청을 위해 필요로된다. 범위 자체가 범위 put 의해 변경된 경우 ()) (삭제 또는 삭제 () 메서드는 그것이 프레임 워크에 통지 할 필요는 없다.

응용 프로그램이 클러스터 된 환경에 전개되지 않으면 ADF 메모리 범위에 대한 변경 내용 추적이 필요하며, 기본적으로이 기능은 비활성화되어 있습니다. ADF 메모리 범위 변경을 추적하고 페이지 플로우 범위를 복제하여 서버 클러스터의 범위를 표시하려면 ADF 컨트롤러를 사용하려면 trueADF-config.xml 파일 내의 < ADF- 범위 -HA- 지원> 매개 변수를 설정합니다. 범위의 복제는 작은 성능 오버 헤드가 있기 때문에, 그것은 서버 클러스터 환경에서 실행중인 응용 프로그램에만 적용해야합니다.

24-10ADF-config.xml 파일에서 true로 설정 ADF- 범위 -HA- 지원을 보여줍니다.

ADF-config.xml 파일의 예제 24-10 ADF- 범위 -HA- 지원 매개 변수

<? xml 버전 = "1.0"인코딩 = "US-ASCII"? >
<ADF- 설정 xmlns = "http://xmlns.oracle.com/adf/config"
xmlns : ADFC = "http://xmlns.oracle.com/adf/controller/config">
<ADFC : ADF- 컨트롤러 -config>
...
<ADFC : ADF- 범위 -HA- 지원> 진정한 </ ADFC : ADF- 범위 -HA- 지원>
...
</ ADFC : ADF- 컨트롤러 -config>
...
</ ADF-config>

























from -

https://docs.oracle.com/cd/E16162_01/web.1112/e16182/web_getstarted.htm#ADFFD568